现场调试修改 入库 出库 放货重新分配货位

This commit is contained in:
liuhanqing
2025-12-26 13:23:28 +08:00
parent ced125c8e9
commit 6b56e5f2ad
53 changed files with 3397 additions and 1832 deletions

View File

@@ -2,12 +2,12 @@
<view class="container">
<view class="warehouse-selector">
<uni-forms>
<uni-forms-item :label="$t('spaceAnalysis.warehouse')">
<uni-forms-item label="仓库:">
<uni-data-select
v-model="selectedWarehouseId"
:localdata="warehouseList"
:clear="false"
:placeholder="$t('spaceAnalysis.warehousePlaceholder')"
placeholder="请选择仓库"
@change="handleWarehouseChange"
/>
</uni-forms-item>
@@ -58,7 +58,7 @@ export default {
},
pieOpts: {
title: {
name: this.$t('spaceAnalysis.cargoSpaceStatus'),
name: '货位状态分布',
fontSize: 15
},
legend: {
@@ -86,7 +86,7 @@ export default {
},
columnOpts: {
title: {
name: this.$t('spaceAnalysis.aisleStatistics'),
name: '巷道出入库统计',
fontSize: 15
},
legend: {
@@ -96,7 +96,7 @@ export default {
fontSize: 12
},
yAxis: {
name: this.$t('spaceAnalysis.quantity'),
name: '数量',
fontSize: 12
},
extra: {
@@ -159,12 +159,12 @@ export default {
if (res.code === 200 && res.data) {
// 更新柱状图数据
this.columnData = {
categories: [`1${this.$t('spaceAnalysis.aisle')}`],
categories: ['1巷道'],
series: [{
name: this.$t('spaceAnalysis.inboundQuantity'),
name: '入库数量',
data:[res.data["in"]]
},{
name: this.$t('spaceAnalysis.outboundQuantity'),
name: '出库数量',
data:[res.data["out"]]
}]
}

View File

@@ -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

View File

@@ -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'
})
}
}
}
}

View File

@@ -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'
})
}

View File

@@ -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'
})
})

View File

@@ -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>

View File

@@ -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

View File

@@ -2,19 +2,19 @@
<view class="container">
<!-- 顶部信息卡片 -->
<view class="info-card">
<text class="welcome">{{ $t('home.greeting') }}{{ userName }}</text>
<text class="date">{{ $t('home.today') }}{{ currentDate }}</text>
<text class="welcome">你好,{{ userName }}</text>
<text class="date">今天是{{ currentDate }}</text>
<view class="stats-row">
<!-- <view class="stats-row"> -->
<!-- <view class="stat-item">
<text class="stat-label">{{ $t('home.taskCompletionRate') }}</text>
<text class="stat-label">任务完成率</text>
<text class="stat-value">98%</text>
</view> -->
<view class="stat-item" >
<text class="stat-label">{{ $t('home.pendingTasks') }}</text>
<!-- <view class="stat-item" >
<text class="stat-label">待处理任务</text>
<text class="stat-value">{{ pendingTaskCount }}</text>
</view>
</view>
</view> -->
</view>
<!-- 今日数据统计 -->
@@ -42,35 +42,45 @@
<image src="/static/images/tabbar/caigouruku.png" mode="aspectFit" class="icon-image"></image>
</view>
<view class="function-text">
<text class="title">{{ $t('home.inbound.title') }}</text>
<text class="desc">{{ $t('home.inbound.desc') }}</text>
<text class="title">入库管理</text>
<text class="desc">收货、上架、验收</text>
</view>
</view>
<view class="function-item" @click="navigateTo('/pages/out/menu')">
<view class="function-item" @click="navigateTo('/pages/out/ckMakeSureByTray')">
<view class="icon-box green">
<image src="/static/images/tabbar/chukudan.png" mode="aspectFit" class="icon-image"></image>
</view>
<view class="function-text">
<text class="title">{{ $t('home.outbound.title') }}</text>
<text class="desc">{{ $t('home.outbound.desc') }}</text>
<text class="title">出库管理</text>
<text class="desc">拣货、打包、发货</text>
</view>
</view>
<view class="function-item" @click="navigateTo('/pages/charts/spaceAnalysis')">
<view class="function-item" @click="navigateTo('/pages/ktp/menu')">
<view class="icon-box orange">
<image src="/static/images/tabbar/tray121.png" mode="aspectFit" class="icon-image"></image>
</view>
<view class="function-text">
<text class="title">托盘管理</text>
<text class="desc">空托盘出入库</text>
</view>
</view>
<!-- <view class="function-item" @click="navigateTo('/pages/charts/spaceAnalysis')">
<view class="icon-box orange">
<image src="/static/images/tabbar/warehouse.png" mode="aspectFit" class="icon-image"></image>
</view>
<view class="function-text">
<text class="title">{{ $t('home.inventory.title') }}</text>
<text class="desc">{{ $t('home.inventory.desc') }}</text>
<text class="title">库存分析</text>
<text class="desc">查询、移库、调整</text>
</view>
</view>
<view class="function-item" @click="navigateTo('/pages/pandian/menu')">
</view> -->
<view class="function-item" @click="navigateTo('/pages/pandian/confirm')">
<view class="icon-box purple">
<image src="/static/images/tabbar/pandian.png" mode="aspectFit" class="icon-image"></image>
</view>
<view class="function-text">
<text class="title">{{ $t('home.stocktaking.title') }}</text>
<text class="desc">{{ $t('home.stocktaking.desc') }}</text>
<text class="title">盘点管理</text>
<text class="desc">周期盘点、抽查</text>
</view>
</view>
</view>
@@ -78,8 +88,7 @@
</template>
<script>
import { getPrepareTask } from '@/api/search/job'
import { getPrepareTask } from '@/api/search/job.js'
export default {
data() {
return {
@@ -95,13 +104,8 @@ export default {
const day = date.getDate();
const weekDayIndex = date.getDay();
if (this.$i18n.locale === 'en-US') {
const weekDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
return `${year}-${month}-${day} ${weekDays[weekDayIndex]}`;
} else {
const weekDays = ['日', '一', '二', '三', '四', '五', '六'];
return `${year}年${month}月${day}日 星期${weekDays[weekDayIndex]}`;
}
const weekDays = ['日', '一', '二', '三', '四', '五', '六'];
return `${year}年${month}月${day}日 星期${weekDays[weekDayIndex]}`;
}
},
@@ -109,25 +113,25 @@ export default {
// 确保用户信息已加载
this.userName = this.$store.getters.name
// 获取待处理任务数量
this.getPendingTaskCount()
// this.getPendingTaskCount()
},
methods: {
navigateTo(url) {
uni.navigateTo({
url: url
})
},
async getPendingTaskCount() {
// 调用API获取待处理任务数量
const response=await getPrepareTask({inOut:''})
if(response.code=== 200){
this.pendingTaskCount=response.data.length
}else{
this.pendingTaskCount=0
}
}
// async getPendingTaskCount() {
// // 调用API获取待处理任务数量
// const response=await getPrepareTask({inOut:''})
// if(response.code=== 200){
// this.pendingTaskCount=response.data.length
// }else{
// this.pendingTaskCount=0
// }
// }
}
}
</script>

View File

@@ -3,12 +3,12 @@
<view class="logo-content align-center justify-center flex">
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
</image>
<text class="title">{{ $t('login.appTitle') }}</text>
<text class="title">WMS手持终端</text>
</view>
<view class="login-form-content">
<view class="input-item flex align-center">
<view class="iconfont icon-user icon"></view>
<input v-model="loginForm.username" class="input" type="text" :placeholder="$t('login.usernamePlaceholder')" maxlength="30" @focus="showAccountList = true" @input="handleUsernameInput" />
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" @focus="showAccountList = true" @input="handleUsernameInput" />
<view class="history-accounts" v-if="showAccountList && historyAccounts.length > 0">
<view v-for="(account, index) in historyAccounts" :key="index" class="account-item" @click="selectAccount(account)">
{{ account }}
@@ -17,15 +17,15 @@
</view>
<view class="input-item flex align-center">
<view class="iconfont icon-password icon"></view>
<input v-model="loginForm.password" type="password" class="input" :placeholder="$t('login.passwordPlaceholder')" maxlength="20" />
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
</view>
<view class="remember-account flex align-center">
<checkbox :checked="rememberAccount" @click="toggleRememberAccount" style="transform:scale(0.7)" />
<text class="text-grey1" >{{ $t('login.rememberAccount') }}</text>
<text class="text-grey1" >记住账号</text>
</view>
<view class="action-btn">
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">{{ $t('login.login') }}</button>
<button @click="goToSettings" class="settings-btn cu-btn block lg round">{{ $t('login.serverSettings') }}</button>
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
<button @click="goToSettings" class="settings-btn cu-btn block lg round">服务器设置</button>
</view>
<!-- <view class="reg text-center" v-if="register">
<text class="text-grey1">没有账号?</text>
@@ -38,8 +38,8 @@
</view> -->
</view>
<view class="copyright-section text-center">
<text class="version">{{ $t('login.version') }}</text>
<text class="copyright">{{ $t('login.copyright') }}</text>
<text class="version">Version 1.0.0</text>
<text class="copyright">© 2025 WMS仓储管理系统</text>
</view>
</view>
</template>
@@ -95,11 +95,11 @@
if (this.loginForm.username === "") {
this.$modal.msgError(this.$t('login.usernameRequired'))
this.$modal.msgError('请输入您的账号')
} else if (this.loginForm.password === "") {
this.$modal.msgError(this.$t('login.passwordRequired'))
this.$modal.msgError('请输入您的密码')
} else {
this.$modal.loading(this.$t('login.loggingIn'))
this.$modal.loading('登录中,请耐心等待...')
this.pwdLogin()
}
},

View File

@@ -10,16 +10,16 @@
<image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
</image>
<view v-if="!name" @click="handleToLogin" class="login-tip">
{{ $t('mine.clickToLogin') }}
点击登录
</view>
<view v-if="name" @click="handleToInfo" class="user-info">
<view class="u_title">
{{ $t('mine.username') }}:{{ name }}
用户名:{{ name }}
</view>
</view>
</view>
<view @click="handleToInfo" class="flex align-center info-link">
<text>{{ $t('mine.personalInfo') }}</text>
<text>个人信息</text>
<view class="iconfont icon-right"></view>
</view>
</view>
@@ -67,7 +67,7 @@
<view class="list-cell list-cell-arrow" @click="handleToSetting">
<view class="menu-item-box">
<view class="iconfont icon-setting menu-icon"></view>
<view>{{ $t('mine.appSettings') }}</view>
<view>应用设置</view>
</view>
</view>
</view>
@@ -110,7 +110,7 @@
this.$tab.navigateTo('/pages/mine/avatar/index')
},
handleLogout() {
this.$modal.confirm(this.$t('mine.logoutConfirm')).then(() => {
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
this.$store.dispatch('LogOut').then(() => {
this.$tab.reLaunch('/pages/index')
})
@@ -126,7 +126,7 @@
this.$modal.showToast('QQ:①133713780(Full)、②146013835(Full)、③189091635')
},
handleBuilding() {
this.$modal.showToast(this.$t('mine.moduleBuilding'))
this.$modal.showToast('模块建设中~')
}
}
}

View File

@@ -22,14 +22,14 @@
<view class="list-cell list-cell-arrow" @click="handleToServerConfig">
<view class="menu-item-box">
<view class="iconfont icon-edit menu-icon"></view>
<view> {{ $t('mine.setting.updateServer') }}</view>
<view>修改服务器配置</view>
</view>
</view>
</view>
<view class="cu-list menu">
<view class="cu-item item-box">
<view class="content text-center" @click="handleLogout">
<text class="text-black">{{ $t('mine.setting.logout') }}</text>
<text class="text-black">退出登录</text>
</view>
</view>
</view>
@@ -126,7 +126,7 @@
this.$tab.navigateTo('/pages/setting')
},
handleLogout() {
this.$modal.confirm(this.$t('mine.logoutConfirm')).then(() => {
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
this.$store.dispatch('LogOut').then(() => {
this.$tab.reLaunch('/pages/login')
})

View File

@@ -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

View File

@@ -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 {

View File

@@ -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'
})
}

View File

@@ -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'
})
}
}
}

View File

@@ -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'
})
}

View File

@@ -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>

View File

@@ -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'
})
}

View File

@@ -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'
})
}
}
}

View File

@@ -1,60 +1,146 @@
<template>
<view class="container">
<!-- 出口选择框 -->
<!-- <view class="input-group">
<text class="input-label">选择出口</text>
<uni-data-select
v-model="selectedExit"
:localdata="exitOptions"
placeholder="请选择出口"
class="select-input">
</uni-data-select>
</view> -->
<view class="input-group">
<view class="input-label">托盘条码:</view>
<uni-easyinput
v-model="trayCode"
:placeholder="$t('stocktaking.confirm.trayCodePlaceholder')"
placeholder="请输入或扫码输入托盘条码"
:clearable="true"
@input="handleInput"
@clear="handleClear"
ref="trayCodeInput"
>
<template #right>
<text class="scan-icon" @click="handleScan">📷</text>
</template>
</uni-easyinput>
</view>
<view class="materials-list" v-if="materialList.length > 0">
<button class="add-button" @click="showAddMaterialPopup">{{ $t('stocktaking.confirm.addMaterial') }}</button>
<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('stocktaking.confirm.systemQuantity') }}: {{ item.outQuantity }}{{ $t('stocktaking.confirm.unit') }}</text>
</view>
<view class="material-content">
<view class="quantity-control">
<button class="control-btn" @click="item.countQuantity = Math.max(0, Number(item.countQuantity) - 1)">-</button>
<text class="quantity-value">{{ item.countQuantity }}</text>
<button class="control-btn" @click="item.countQuantity = Number(item.countQuantity) + 1">+</button>
<text class="quantity-diff" :class="{ 'plus': item.countQuantity > item.outQuantity, 'minus': item.countQuantity < item.outQuantity,'equal':item.countQuantity==item.outQuantity }">{{ item.countQuantity > item.outQuantity ? $t('stocktaking.confirm.surplus') + (item.countQuantity - item.outQuantity) : item.countQuantity < item.outQuantity ? $t('stocktaking.confirm.loss') + (item.outQuantity - item.countQuantity) : $t('stocktaking.confirm.match') }}</text>
<button class="clear-btn" @click="item.countQuantity = 0">{{ $t('stocktaking.confirm.clearQuantity') }}</button>
</view>
</view>
</view>
</view>
<view class="materials-list">
<view v-for="(item, index) in materialList" :key="index" class="material-card">
<view class="material-header">
<text class="material-title">{{ item.productName }}</text>
<view class="material-code-section">
<view class="code-input-group">
<text class="code-label">物料编码:</text>
<uni-easyinput
v-model="item.productId"
placeholder="请输入物料编码"
class="code-input"
@input="handleMaterialCodeChange(index, $event)"
/>
</view>
<view class="code-input-group">
<text class="code-label">盘点数量:</text>
<uni-easyinput
v-model="item.countQuantity"
type="number"
placeholder="请输入盘点数量"
class="code-input"
@input="handleMaterialQtyChange(index, $event)"
/>
</view>
<text class="quantity-info">系统数量: {{ item.outQuantity }}件</text>
</view>
</view>
</view>
<button class="add-button" @click="showAddMaterialPopup">新增</button>
</view>
<view class="button-group" v-if="materialList.length > 0">
<button class="confirm-button" @click="handleConfirm">{{ $t('stocktaking.confirm.confirmStocktaking') }}</button>
<button class="confirm-button" @click="handleConfirm">确认盘点</button>
</view>
<!-- 新增物料弹窗 -->
<uni-popup ref="addMaterialPopup" type="center">
<view class="popup-content">
<view class="popup-title">{{ $t('stocktaking.confirm.addMaterialTitle') }}</view>
<view class="popup-form">
<view class="form-item">
<text class="form-label">{{ $t('stocktaking.confirm.materialCodeLabel') }}</text>
<uni-easyinput v-model="newMaterial.productId" :placeholder="$t('stocktaking.confirm.materialCodePlaceholder')" />
<view class="popup-title">新增物料</view>
<view class="popup-form grid">
<view class="form-row">
<view class="form-col">
<text class="form-label">物料编码</text>
<uni-easyinput v-model="newMaterial.productId" placeholder="请输入物料编码" />
</view>
<view class="form-col">
<text class="form-label">数量</text>
<uni-easyinput v-model="newMaterial.inQuantity" type="number" placeholder="请输入数量" />
</view>
</view>
<view class="form-item">
<text class="form-label">{{ $t('stocktaking.confirm.quantityLabel') }}</text>
<uni-easyinput v-model="newMaterial.inQuantity" type="number" :placeholder="$t('stocktaking.confirm.quantityPlaceholder')" />
<view class="form-row">
<view class="form-col">
<text class="form-label">台次</text>
<uni-easyinput v-model="newMaterial.spare5" placeholder="请输入台次" />
</view>
<view class="form-col">
<text class="form-label">件次</text>
<uni-easyinput v-model="newMaterial.spare7" placeholder="请输入件次" />
</view>
</view>
<view class="form-row">
<view class="form-col">
<text class="form-label">合同号</text>
<uni-easyinput v-model="newMaterial.spare6" placeholder="请输入合同号" />
</view>
<view class="form-col">
<text class="form-label">管理号</text>
<uni-easyinput v-model="newMaterial.spare9" placeholder="请输入管理号" />
</view>
</view>
<view class="form-row">
<view class="form-col">
<text class="form-label">质量等级</text>
<uni-data-select :localdata="productStatus" v-model="newMaterial.spare8" placeholder="请选择质量等级"></uni-data-select>
</view>
<view class="form-col">
<text class="form-label">批次</text>
<uni-easyinput v-model="newMaterial.lotNo" placeholder="请输入批次" />
</view>
</view>
<!-- 可选扩展项(暂不显示) -->
<view class="form-row">
<view class="form-col">
<text class="form-label">状态</text>
<uni-data-select :localdata="turnover_type" v-model="newMaterial.spare2" placeholder="请选择状态"></uni-data-select>
</view>
<view class="form-col">
<text class="form-label">套账</text>
<uni-data-select :localdata="account_type" v-model="newMaterial.spare3" placeholder="请选择套账"></uni-data-select>
</view>
</view>
<view class="form-row">
<view class="form-col">
<text class="form-label">来源</text>
<uni-data-select :localdata="origin_type" v-model="newMaterial.spare1" placeholder="请选择来源"></uni-data-select>
</view>
<view class="form-col">
<text class="form-label">用途</text>
<uni-data-select :localdata="purpose_type" v-model="newMaterial.spare4" placeholder="请选择用途"></uni-data-select>
</view>
</view>
<view class="form-row">
<view class="form-col">
<text class="form-label">供应商</text>
<uni-easyinput v-model="newMaterial.supplierId" placeholder="请输入供应商"/>
</view>
<view class="form-col">
<text class="form-label">单价</text>
<uni-easyinput v-model="newMaterial.printDate" placeholder="请输入单价"/>
</view>
</view>
</view>
<view class="popup-buttons">
<button class="cancel-btn" @click="hideAddMaterialPopup">{{ $t('stocktaking.confirm.cancel') }}</button>
<button class="submit-btn" @click="handleAddMaterial">{{ $t('stocktaking.confirm.confirm') }}</button>
<button class="cancel-btn" @click="hideAddMaterialPopup">取消</button>
<button class="submit-btn" @click="handleAddMaterial">确定</button>
</view>
</view>
</uni-popup>
@@ -62,8 +148,7 @@
</template>
<script>
import { getTrayMaterials, confirmPandian } from '@/api/pandian/confirm.js'
import { confirmPandian,getTaskDetail } from '@/api/pandian/confirm.js'
export default {
onReady() {
setTimeout(() => {
@@ -74,17 +159,57 @@
},
data() {
return {
selectedExit: '',
exitOptions: [
{ value: '1', text: '1' },
{ value: '1', text: '1' }
],
productStatus:[
{ value:'1',text:'优秀'},
{ value:'2',text:'良好'},
{ value:'3',text:'合格'},
{ value:'4',text:'不合格'}
],
origin_type:[
{ value:'1',text:'国产'},
{ value:'2',text:'进口'}
],
turnover_type:[
{ value:'1',text:'正常'},
{ value:'2',text:'积压'}
],
account_type:[
{ value:'1',text:'帐内'},
{ value:'2',text:'帐外'}
],
purpose_type:[
{ value:'1',text:'民用'},
{ value:'2',text:'军用'}
],
trayCode: '',
materialList: [],
newMaterial: {
productId: '',
inQuantity: ''
inQuantity: '',
spare5:'',//台次
spare6:'',//合同号
spare7:'',//件次
spare8:'',//质量等级
spare9:'',//管理号
spare1:'',//来源
spare2:'',//状态
spare3:'',//套账
spare4:'',//用途
supplierId:'',
printDate:''
}
}
},
methods: {
methods: {
// 处理输入事件
handleInput(value) {
if (value) {
this.fetchTrayInfo(value)
}
@@ -93,26 +218,40 @@
handleClear() {
this.materialList = []
},
// 处理物料编码变化
handleMaterialCodeChange(index, value) {
this.materialList[index].productId = value
},
// 处理盘点数量变化
handleMaterialQtyChange(index, value) {
const num = Number(value)
if (Number.isNaN(num) || num < 0) {
this.materialList[index].countQuantity = 0
uni.showToast({ title: '数量需为非负数字', icon: 'none' })
} else {
this.materialList[index].countQuantity = num
}
},
// 处理扫码事件
handleScan() {
uni.scanCode({
success: (res) => {
this.trayCode = res.result
this.fetchTrayInfo(res.result)
}
})
},
// handleScan() {
// uni.scanCode({
// success: (res) => {
// this.trayCode = res.result
// this.fetchTrayInfo(res.result)
// }
// })
// },
// 获取托盘信息
async fetchTrayInfo(trayCode) {
try {
const response = await getTrayMaterials({trayCode:trayCode,inOut:'4'})
const response = await getTaskDetail({trayCode:trayCode})
this.materialList = response.data.map(item => ({
...item,
countQuantity: item.outQuantity
}))
} catch (error) {
uni.showToast({
title: this.$t('stocktaking.confirm.getTrayInfoFailed'),
title: '获取托盘信息失败',
icon: 'none'
})
}
@@ -126,14 +265,25 @@
this.$refs.addMaterialPopup.close()
this.newMaterial = {
productId: '',
inQuantity: ''
inQuantity: '',
spare5:'',//台次
spare6:'',//合同号
spare7:'',//件次
spare8:'',//质量等级
spare9:'',//管理号
spare1:'',//来源
spare2:'',//状态
spare3:'',//套账
spare4:'',//用途
supplierId:'',
printDate:''
}
},
// 处理新增物料
handleAddMaterial() {
if (!this.newMaterial.productId || !this.newMaterial.inQuantity) {
uni.showToast({
title: this.$t('stocktaking.confirm.fillCompleteInfo'),
title: '请填写完整信息',
icon: 'none'
})
return
@@ -144,45 +294,76 @@
countQuantity: Number(this.newMaterial.inQuantity),
outQuantity: 0,
stockId: null,
extraField: {
materialDesc: ''
}
spare5:this.newMaterial.spare5,//台次
spare6:this.newMaterial.spare6,//合同号
spare7:this.newMaterial.spare7,//件次
spare8:this.newMaterial.spare8,//质量等级
spare9:this.newMaterial.spare9,//管理号
spare1:this.newMaterial.spare1,//来源
spare2:this.newMaterial.spare2,//状态
spare3:this.newMaterial.spare3,//套账
spare4:this.newMaterial.spare4,//用途
supplierId:this.newMaterial.supplierId,
printDate:this.newMaterial.printDate
})
this.hideAddMaterialPopup()
uni.showToast({
title: this.$t('stocktaking.confirm.addSuccess'),
title: '新增成功',
icon: 'success'
})
},
// 确认盘点
async handleConfirm() {
try {
const data = {
trayCode: this.trayCode,
materials: this.materialList.map(item => ({
stockId: item.stockId,
productId:item.productId,
jobDetailId:item.jobDetailId,
inQuantity: item.countQuantity,
inOrOutDId:item.inOrOutDId
}))
}
// 验证出口选择
// if (!this.selectedExit) {
// uni.showToast({
// title: '请选择出口',
// icon: 'none'
// })
// return
// }
try {
const data = {
trayCode: this.trayCode,
// exitId: this.selectedExit,
materials: this.materialList.map(item => ({
stockId: item.stockId,
productId:item.productId,
jobDetailId:item.jobDetailId,
inQuantity: Number(item.countQuantity) || 0,
inOrOutDId:item.inOrOutDId,
spare5:item.spare5,//台次
spare6:item.spare6,//合同号
spare7:item.spare7,//件次
spare8:item.spare8,//质量等级
spare9:item.spare9,//管理号
spare1:item.spare1,//来源
spare2:item.spare2,//状态
spare3:item.spare3,//套账
spare4:item.spare4,//用途
supplierId:item.supplierId,
printDate:item.printDate
}))
}
const response=await confirmPandian(data)
if(response.code==200){
uni.showToast({
title: this.$t('stocktaking.confirm.stocktakingSuccess'),
title: '盘点成功',
icon: 'success'
})
// 清空数据
this.trayCode = ''
this.materialList = []
this.selectedExit = ''
}
} catch (error) {
uni.showToast({
title: this.$t('stocktaking.confirm.stocktakingFailed'),
title: '盘点失败',
icon: 'none'
})
}
@@ -218,6 +399,23 @@
padding: 0 20rpx;
}
.input-label {
font-size: 28rpx;
color: #333;
margin-bottom: 16rpx;
display: block;
font-weight: 500;
}
.select-input {
:deep(.uni-data-select) {
background-color: #f8f8f8;
border-radius: 8rpx;
height: 80rpx;
padding: 0 24rpx;
}
}
.materials-list {
padding: 0 20rpx;
}
@@ -250,13 +448,54 @@
color: #333;
font-weight: 500;
display: block;
margin-bottom: 8rpx;
margin-bottom: 12rpx;
}
.material-code {
.material-code-section {
display: flex;
flex-direction: column;
gap: 8rpx;
}
.code-input-group {
display: flex;
align-items: center;
gap: 12rpx;
}
.code-label {
font-size: 28rpx;
color: #666;
display: block;
min-width: 140rpx;
flex-shrink: 0;
}
.code-input {
flex: 1;
:deep(.uni-easyinput__content) {
background-color: #f8f9fa;
border-radius: 6rpx;
height: 60rpx;
padding: 0 16rpx;
border: 1rpx solid #e9ecef;
&:focus-within {
border-color: #3B7FFF;
background-color: #fff;
}
}
:deep(.uni-easyinput__content-input) {
font-size: 26rpx;
color: #333;
}
}
.quantity-info {
font-size: 26rpx;
color: #666;
margin-left: 152rpx;
}
.material-content {
@@ -369,18 +608,43 @@
}
.popup-form {
margin-bottom: 30rpx;
}
.form-item {
margin-bottom: 20rpx;
margin-bottom: 30rpx;
}
.form-label {
font-size: 28rpx;
color: #333;
margin-bottom: 10rpx;
display: block;
font-size: 28rpx;
color: #333;
margin-bottom: 10rpx;
display: block;
}
/* 弹窗两列表单布局 */
.popup-form.grid {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.form-row {
display: flex;
gap: 20rpx;
}
.form-col {
flex: 1;
}
.form-col :deep(.uni-easyinput__content),
.form-col :deep(.uni-data-select) {
background-color: #f8f8f8;
border-radius: 8rpx;
height: 72rpx;
padding: 0 20rpx;
}
.form-col :deep(.uni-easyinput__content-input) {
font-size: 26rpx;
color: #333;
}
.popup-buttons {

View File

@@ -6,8 +6,8 @@
<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('stocktaking.confirm.title') }}</text>
<text class="desc">{{ $t('stocktaking.confirm.desc') }}</text>
<text class="title">盘点确认</text>
<text class="desc">托盘物料盘点确认</text>
</view>
</view>
<view class="function-item" @click="navigateTo('/pages/pandian/pkconfirm')">
@@ -15,8 +15,8 @@
<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('stocktaking.confirmPK.title') }}</text>
<text class="desc">{{ $t('stocktaking.confirmPK.desc') }}</text>
<text class="title">盘点确认(PK)</text>
<text class="desc">托盘物料盘点确认(PK)</text>
</view>
</view>
</view>

View File

@@ -5,13 +5,13 @@
v-model="selectedWarehouse"
:localdata="warehouseList"
:clear="false"
:placeholder="$t('stocktaking.confirmPK.selectWarehouse')"
placeholder="请选择仓库"
@change="handleWarehouseChange"
/>
</view>
<view class="add-button-container" v-if="selectedWarehouse!=''">
<button class="add-button" @click="showAddMaterialPopup">{{ $t('stocktaking.confirmPK.addMaterial') }}</button>
<button class="add-button" @click="showAddMaterialPopup">新增物料</button>
</view>
<view class="inventory-list" v-if="inventoryList.length > 0">
@@ -19,19 +19,19 @@
<uni-card>
<view class="card-content">
<view class="info-row">
<text class="label">{{ $t('stocktaking.confirmPK.materialCode') }}:</text>
<text class="label">物料编码:</text>
<text class="value">{{ item.extraField.productId }}</text>
</view>
<view class="info-row">
<text class="label">{{ $t('stocktaking.confirmPK.materialName') }}:</text>
<text class="label">物料名称:</text>
<text class="value">{{ item.extraField.materialDesc }}</text>
</view>
<view class="info-row">
<text class="label">{{ $t('stocktaking.confirmPK.inventoryQuantity') }}:</text>
<text class="label">库存数量:</text>
<text class="value">{{ item.quantity }}</text>
</view>
<view class="info-row">
<text class="label">{{ $t('stocktaking.confirmPK.countQuantity') }}:</text>
<text class="label">盘点数量:</text>
<view class="value">
<uni-easyinput
v-model.number="item.newQuantity"
@@ -43,7 +43,7 @@
</view>
</view>
<view class="button-row">
<button class="confirm-button" @click="handleConfirm(item)">{{ $t('stocktaking.confirmPK.countButton') }}</button>
<button class="confirm-button" @click="handleConfirm(item)">盘点</button>
</view>
</view>
</uni-card>
@@ -51,26 +51,26 @@
</view>
<view class="empty-state" v-else>
<text>{{ $t('stocktaking.confirmPK.noInventoryData') }}</text>
<text>暂无盘点数据</text>
</view>
<!-- 新增物料弹窗 -->
<uni-popup ref="addMaterialPopup" type="center">
<view class="popup-content">
<view class="popup-title">{{ $t('stocktaking.confirmPK.addMaterialTitle') }}</view>
<view class="popup-title">新增物料</view>
<view class="popup-form">
<view class="form-item">
<text class="form-label">{{ $t('stocktaking.confirmPK.materialCodeLabel') }}</text>
<uni-easyinput v-model="newMaterial.productId" :placeholder="$t('stocktaking.confirm.materialCodePlaceholder')" />
<text class="form-label">物料编码</text>
<uni-easyinput v-model="newMaterial.productId" placeholder="请输入物料编码" />
</view>
<view class="form-item">
<text class="form-label">{{ $t('stocktaking.confirmPK.quantityLabel') }}</text>
<uni-easyinput v-model="newMaterial.newQuantity" type="number" :placeholder="$t('stocktaking.confirm.quantityPlaceholder')" />
<text class="form-label">数量</text>
<uni-easyinput v-model="newMaterial.newQuantity" type="number" placeholder="请输入数量" />
</view>
</view>
<view class="popup-buttons">
<button class="cancel-btn" @click="hideAddMaterialPopup">{{ $t('stocktaking.confirmPK.cancel') }}</button>
<button class="submit-btn" @click="handleAddMaterial">{{ $t('stocktaking.confirmPK.confirm') }}</button>
<button class="cancel-btn" @click="hideAddMaterialPopup">取消</button>
<button class="submit-btn" @click="handleAddMaterial">确定</button>
</view>
</view>
</uni-popup>
@@ -122,7 +122,7 @@
} catch (error) {
console.error('获取仓库列表失败:', error)
uni.showToast({
title: this.$t('stocktaking.confirmPK.getWarehouseListFailed'),
title: '获取仓库列表失败',
icon: 'none'
})
}
@@ -144,7 +144,7 @@
} catch (error) {
console.error('获取库存列表失败:', error)
uni.showToast({
title: this.$t('stocktaking.confirmPK.getInventoryListFailed'),
title: '获取库存列表失败',
icon: 'none'
})
}
@@ -159,14 +159,14 @@
async handleConfirm(item) {
if (!item.newQuantity || item.newQuantity < 0) {
uni.showToast({
title: this.$t('stocktaking.confirmPK.enterValidCountQuantity'),
title: '请输入有效的盘点数量',
icon: 'none'
})
return
}
if(item.newQuantity==item.quantity){
uni.showToast({
title: this.$t('stocktaking.confirmPK.quantityMatch'),
title: '库存数量与盘点数量一致,无需盘点',
icon: 'none'
})
}
@@ -181,21 +181,21 @@
if (response.code === 200) {
uni.showToast({
title: this.$t('stocktaking.confirmPK.countSuccess'),
title: '盘点成功',
icon: 'success'
})
// 刷新库存列表
this.getInventoryList()
} else {
uni.showToast({
title: response.msg || this.$t('stocktaking.confirmPK.countFailed'),
title: response.msg || '盘点失败',
icon: 'none'
})
}
} catch (error) {
console.error('盘点失败:', error)
uni.showToast({
title: this.$t('stocktaking.confirmPK.countFailed'),
title: '盘点失败',
icon: 'none'
})
}
@@ -213,7 +213,7 @@
showAddMaterialPopup() {
if(!this.selectedWarehouse)
return uni.showToast({
title: this.$t('stocktaking.confirmPK.selectWarehouse'),
title: '请选择仓库',
icon: 'none'
})
this.$refs.addMaterialPopup.open()
@@ -233,7 +233,7 @@
async handleAddMaterial() {
if (!this.newMaterial.productId || !this.newMaterial.newQuantity || this.newMaterial.newQuantity < 0) {
uni.showToast({
title: this.$t('stocktaking.confirmPK.enterValidMaterialInfo'),
title: '请输入有效的物料信息',
icon: 'none'
})
return
@@ -249,7 +249,7 @@
if (response.code === 200) {
uni.showToast({
title: this.$t('stocktaking.confirmPK.addSuccess'),
title: '新增成功',
icon: 'success'
})
// 关闭弹窗并刷新列表
@@ -257,7 +257,7 @@
this.getInventoryList()
} else {
uni.showToast({
title: response.msg || this.$t('stocktaking.confirmPK.addFailed'),
title: response.msg || '新增失败',
icon: 'none'
})
}

View File

@@ -2,21 +2,21 @@
<view class="container">
<view class="form-card">
<uni-forms>
<uni-forms-item :label="$t('settings.ipLabel')">
<uni-easyinput v-model="settingformData.ip" :placeholder="$t('settings.ipPlaceholder')" />
<uni-forms-item label="IP:">
<uni-easyinput v-model="settingformData.ip" placeholder="请输入IP地址" />
</uni-forms-item>
<uni-forms-item :label="$t('settings.portLabel')">
<uni-easyinput v-model="settingformData.port" :placeholder="$t('settings.portPlaceholder')" />
<uni-forms-item label="端口:">
<uni-easyinput v-model="settingformData.port" placeholder="请输入端口号" />
</uni-forms-item>
</uni-forms>
<button class="submit-button" @click="handleSubmit">{{ $t('settings.saveSettings') }}</button>
<button class="submit-button" @click="handleSubmit">保存设置</button>
<view class="divider"></view>
<view class="language-section">
<text class="section-title">{{ $t('settings.languageSettings') }}</text>
<!-- <view class="language-section">
<text class="section-title">语言设置</text>
<language-switcher></language-switcher>
</view>
</view> -->
</view>
</view>
</template>
@@ -60,32 +60,32 @@
// 验证IP地址
if (!this.settingformData.ip) {
uni.showToast({
title: this.$t('settings.ipRequired'),
icon: 'none'
})
title: '请输入IP地址',
icon: 'none'
})
return
}
if (!this.validateIP(this.settingformData.ip)) {
uni.showToast({
title: this.$t('settings.invalidIpFormat'),
icon: 'none'
})
title: '请输入正确的IP地址格式',
icon: 'none'
})
return
}
// 验证端口号
if (!this.settingformData.port) {
uni.showToast({
title: this.$t('settings.portRequired'),
icon: 'none'
})
title: '请输入端口号',
icon: 'none'
})
return
}
if (!this.validatePort(this.settingformData.port)) {
uni.showToast({
title: this.$t('settings.invalidPortFormat'),
icon: 'none'
})
title: '请输入正确的端口号(1-65535)',
icon: 'none'
})
return
}
@@ -98,8 +98,8 @@
// getApp().globalData.config = config
// console.log("11111",config.baseUrl)
uni.showToast({
title: this.$t('settings.settingsSaved'),
icon: 'success',
title: '设置已保存',
icon: 'success',
complete: () => {
// 延迟跳转,确保Toast显示完成
setTimeout(() => {
@@ -112,9 +112,9 @@
} catch (e) {
console.error('保存设置失败:', e)
uni.showToast({
title: this.$t('settings.saveSettingsFailed'),
icon: 'none'
})
title: '保存设置失败',
icon: 'none'
})
}
}
}

View File

@@ -13,15 +13,15 @@
<view class="task-list" v-if="tasks.length > 0">
<view class="task-item" v-for="(task, index) in tasks" :key="index" @click="handleTaskClick(task)">
<view class="task-info">
<text class="task-title">{{ $t('task.list.trayCode') }}:{{ task.trayCode }}</text>
<text class="task-type">{{ $t('task.list.cargoSpace') }}:{{ task.cargoSpaceName }}</text>
<text class="task-status">{{ $t('task.list.warehouse') }}:{{ task.warehouseName }}</text>
<text class="task-status">{{ $t('task.list.createTime') }}:{{ task.createTime }}</text>
<text class="task-status status-tag">{{ $t('task.list.status') }}:{{ task.status === '1' ? $t('task.list.pending') : task.status === '3' ? $t('task.list.executing') : task.status }}</text>
<text class="task-title">托盘条码:{{ task.trayCode }}</text>
<text class="task-type">货位:{{ task.cargoSpaceName }}</text>
<text class="task-status">仓库:{{ task.warehouseName }}</text>
<text class="task-status">创建时间:{{ task.createTime }}</text>
<text class="task-status status-tag">状态:{{ task.status === '1' ? '待执行' : task.status === '3' ? '正执行' : task.status }}</text>
<view class="task-actions">
<button v-if="task.inOrOut < 20" class="action-button in-button" @click.stop="handleInStock(task)">{{ $t('task.list.inbound') }}</button>
<button v-if="task.inOrOut >= 20 && task.inOrOut != 25 && task.inOrOut != 26" class="action-button out-button" @click.stop="handleOutStock(task)">{{ $t('task.list.outbound') }}</button>
<button v-if="task.inOrOut == 25 || task.inOrOut == 26" class="action-button out-button" @click.stop="handleCheck(task)">{{ $t('task.list.stocktaking') }}</button>
<button v-if="task.inOrOut < 20" class="action-button in-button" @click.stop="handleInStock(task)">入库</button>
<button v-if="task.inOrOut >= 20 && task.inOrOut != 25 && task.inOrOut != 26" class="action-button out-button" @click.stop="handleOutStock(task)">出库</button>
<button v-if="task.inOrOut == 25 || task.inOrOut == 26" class="action-button out-button" @click.stop="handleCheck(task)">盘点</button>
</view>
</view>
</view>
@@ -29,21 +29,21 @@
<!-- 空状态 -->
<view class="empty-state" v-else>
<text>{{ $t('task.list.noTasks') }}</text>
<text>暂无任务</text>
</view>
<!-- 物料详情弹出层 -->
<uni-popup ref="materialPopup" type="center">
<view class="popup-content">
<view class="popup-header">
<text class="popup-title">{{ $t('task.list.materialDetails') }}</text>
<text class="popup-title">物料详情</text>
<text class="close-btn" @click="closePopup">×</text>
</view>
<view class="material-list">
<view class="material-item" v-for="(material, index) in materialDetails" :key="index">
<text class="material-code">{{ $t('task.list.materialCode') }}:{{ material.productId }}</text>
<text class="material-name">{{ $t('task.list.materialName') }}:{{ material.extraField.materialDesc }}</text>
<text class="material-quantity">{{ $t('task.list.quantity') }}:{{ currentTask.inOrOut < 20 ? material.inQuantity : material.outQuantity }}</text>
<text class="material-code">物料编码:{{ material.productId }}</text>
<text class="material-name">物料名称:{{ material.extraField.materialDesc }}</text>
<text class="material-quantity">数量:{{ currentTask.inOrOut < 20 ? material.inQuantity : material.outQuantity }}</text>
</view>
</view>
</view>
@@ -60,10 +60,10 @@ export default {
return {
selectedType: '',
taskTypes: [
{ value: '', text: this.$t('task.list.all') },
{ value: '1', text: this.$t('task.list.inbound') },
{ value: '2', text: this.$t('task.list.outbound') },
{ value: '4', text: this.$t('task.list.stocktaking') }
{ value: '', text: '全部' },
{ value: '1', text: '入库' },
{ value: '2', text: '出库' },
{ value: '4', text: '盘点' }
],
tasks: [],
materialDetails: [],
@@ -82,7 +82,7 @@ export default {
} else {
this.tasks = []
uni.showToast({
title: this.$t('task.list.getTaskListFailed'),
title: '获取任务列表失败',
icon: 'none'
})
}
@@ -90,7 +90,7 @@ export default {
console.error('获取任务列表出错:', error)
this.tasks = []
uni.showToast({
title: this.$t('task.list.getTaskListFailed'),
title: '获取任务列表失败',
icon: 'none'
})
}
@@ -106,20 +106,20 @@ export default {
if (response.code === 200) {
uni.showToast({
title: this.$t('task.list.inboundSuccess'),
title: '入库成功',
icon: 'success'
})
this.fetchTasks()
} else {
uni.showToast({
title: response.msg || this.$t('task.list.inboundFailed'),
title: response.msg || '入库失败',
icon: 'none'
})
}
} catch (error) {
console.error('入库操作失败:', error)
uni.showToast({
title: this.$t('task.list.inboundFailed'),
title: '入库失败',
icon: 'none'
})
}
@@ -145,14 +145,14 @@ export default {
this.$refs.materialPopup.open()
} else {
uni.showToast({
title: this.$t('task.list.getMaterialDetailsFailed'),
title: '获取物料详情失败',
icon: 'none'
})
}
} catch (error) {
console.error('获取物料详情失败:', error)
uni.showToast({
title: this.$t('task.list.getMaterialDetailsFailed'),
title: '获取物料详情失败',
icon: 'none'
})
}