add 空载具入库

This commit is contained in:
2026-01-30 16:39:23 +08:00
parent 9ab6c333c7
commit ea0d0074ae
5 changed files with 222 additions and 1 deletions

View File

@@ -111,6 +111,13 @@
{ {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path" : "pages/manage/empty-carrier-warehousing",
"style" :
{
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {

View File

@@ -43,7 +43,8 @@
{title: '呼叫物料', icon: 'RF09', path: '/pages/manage/call-mater'}, {title: '呼叫物料', icon: 'RF09', path: '/pages/manage/call-mater'},
{title: '补空框', icon: 'RF10', path: '/pages/manage/fill-empty'}, {title: '补空框', icon: 'RF10', path: '/pages/manage/fill-empty'},
{title: '合托', icon: 'RF11', path: '/pages/manage/merge-pallet'}, {title: '合托', icon: 'RF11', path: '/pages/manage/merge-pallet'},
{title: '物料扣减', icon: 'RF12', path: '/pages/manage/mater-update'} {title: '物料扣减', icon: 'RF12', path: '/pages/manage/mater-update'},
{title: '空载具入库', icon: 'RF13', path: '/pages/manage/empty-carrier-warehousing'}
], ],
show: false, show: false,
secM: [] secM: []

View File

@@ -0,0 +1,207 @@
<template>
<view class="zd_container">
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">点位</span>
</view>
<view class="zd-col-17">
<search-box
v-model="point"
@handleChange="handlePointChange"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">载具编码</span>
</view>
<view class="zd-col-17">
<search-box
v-model="vehicle"
@handleChange="handleVehicleChange"
/>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table class="table">
<thead>
<tr>
<th>点位</th>
<th>载具编码</th>
<th>删除</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{e.point_code}}</td>
<td>{{e.vehicle_code}}</td>
<td><view class="delete-btn" @tap="deleteItem(i)">删除</view></td>
</tr>
<tr v-if="uncompletedItem" class="uncompleted-row">
<td>{{uncompletedItem.point_code || '待扫描'}}</td>
<td>{{uncompletedItem.vehicle_code || '待扫描'}}</td>
<td>
<view class="clear-btn" @tap="clearUncompleted">清空</view>
</td>
</tr>
</tbody>
</table>
<view v-if="dataList.length === 0 && !uncompletedItem" class="tip">请扫描点位和载具编码</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-24 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="_emptyVehicleWarehousing">提交</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {emptyVehicleWarehousing} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
point: '',
vehicle: '',
uncompletedItem: null,
dataList: [],
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
handlePointChange(value) {
if (value) {
setTimeout(() => { this.point = '' }, 500)
if (!this.uncompletedItem) {
this.uncompletedItem = { point_code: value }
} else {
this.uncompletedItem.point_code = value
}
this.checkAndAddToList()
}
},
handleVehicleChange(value) {
if (value) {
setTimeout(() => { this.vehicle = '' }, 500)
if (!this.uncompletedItem) {
this.uncompletedItem = { vehicle_code: value }
} else {
this.uncompletedItem.vehicle_code = value
}
this.checkAndAddToList()
}
},
checkAndAddToList() {
if (!this.uncompletedItem) return
const { point_code, vehicle_code } = this.uncompletedItem
if (point_code && vehicle_code) {
const exists = this.dataList.some(item =>
item.point_code === point_code && item.vehicle_code === vehicle_code
)
if (!exists) {
this.dataList.push({
point_code,
vehicle_code
})
this.uncompletedItem = null
} else {
uni.showToast({
title: '该组合已存在',
icon: 'none'
})
this.uncompletedItem = null
}
}
},
clearUncompleted() {
this.uncompletedItem = null
},
deleteItem(index) {
this.dataList.splice(index, 1)
},
async _emptyVehicleWarehousing () {
this.disabled = true
if (!this.dataList.length) {
this.disabled = false
return
}
try {
let res = await emptyVehicleWarehousing(this.dataList)
this.clearUp()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
console.log(e)
this.disabled = false
}
},
clearUp () {
this.point = ''
this.vehicle = ''
this.uncompletedItem = null
this.disabled = false
this.dataList = []
}
}
}
</script>
<style lang="stylus" scoped>
@import '../../common/style/mixin.styl';
.table
width 100%
border-spacing 0
.uncompleted-row
td
background-color #fffaf0
color #333
font-style italic
td
line-height 36rpx
padding 20rpx 10rpx
white-space pre-wrap
word-break break-all
.tip
font-size 32rpx
text-align: center;
padding: 40rpx 0;
color: #ff6a00;
.delete-btn
_font(34rpx, 50rpx, #4e6ef2,,center)
padding 10rpx 20rpx
background-color #fff
border-radius 8rpx
display inline-block
border 1rpx solid #4e6ef2
&:active
color #fff
background-color #4e6ef2
.clear-btn
_font(34rpx, 50rpx, #ff6a00,,center)
padding 10rpx 20rpx
background-color #fff
border-radius 8rpx
display inline-block
border 1rpx solid #ff6a00
&:active
color #fff
background-color #ff6a00
</style>

BIN
static/image/menu/RF13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -134,4 +134,10 @@ export const getGroupByVehicleCode = (code) => request({
export const materialUpdate = (code, arr) => request({ export const materialUpdate = (code, arr) => request({
url:'api/handheld/materialUpdate', url:'api/handheld/materialUpdate',
data: {vehicle_code: code, materials: arr} data: {vehicle_code: code, materials: arr}
})
// 空载具入库
export const emptyVehicleWarehousing = (list) => request({
url:'api/handheld/emptyVehicleWarehousing',
data: {vehicleList: list}
}) })