add单据入库

This commit is contained in:
2025-04-02 16:10:38 +08:00
parent 6f3dd892d7
commit 705dfc36f9
6 changed files with 320 additions and 8 deletions

View File

@@ -526,4 +526,7 @@ uni-button[disabled]:not([type]), uni-button[disabled][type=default] {
}
.del-icon {
right 32px
}
.mini-btn {
margin-right: 0;
}

View File

@@ -298,6 +298,14 @@
}
}
,{
"path" : "pages/entry/bill-to-store",
"style" :
{
"navigationStyle": "custom"
}
}
],
"globalStyle": {
// "pageOrientation": "landscape",

View File

@@ -0,0 +1,264 @@
<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-6">
<span class="filter_label">单据编码</span>
</view>
<view class="zd-col-12">
<search-box v-model="code" @handleChange="handleChange1" @handleDel="handleDel1" />
</view>
<button class="mini-btn" type="primary" size="mini" @tap="toSearch">查询</button>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">物料名称</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_name" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">物料规格</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_spec" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">单位</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.unit_id" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">物料批次</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input" v-model="currentData.pcsn">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">物料数量</span>
</view>
<view class="zd-col-18">
<input type="number" class="filter_input" v-model="val1">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">载具编码</span>
</view>
<view class="zd-col-18">
<search-box v-model="val2" @handleChange="handleChange2" @handleDel="handleDel2" />
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">仓库编码</span>
</view>
<view class="zd-col-18 filter_select">
<!-- <search-box v-model="currentData.stor_code"/> -->
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val1 || !index}" :disabled="disabled" @tap="_inStorageConfirm">组盘确认</button>
</view>
<view class="zd_content msg_wrapper" :class="show ? 'popshow' : 'pophide'">
<view class="pop-line"></view>
<view class="msg_content">
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>序号</th>
<th>物料编码</th>
<th>物料名称</th>
<th>物料规格</th>
<th>单位</th>
<th>物料批次</th>
<th>物料数量</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_code === pkId}" @tap="toCheck(e)">
<td>{{i+1}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.unit_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.qty}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-11 button-default" @tap.stop="show = false">关闭</button>
<button class="zd-col-11 button-primary" :disabled="disabled" @tap="confirmModal">确定</button>
</view>
</view>
<view v-if="show" class="msg_mask"></view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getBillNoInfo, storList, inStorageConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
code: '',
show: false,
dataList: [],
pkId: '',
currentData: {},
val1: null,
val2: null,
options: [],
index: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
this._storList()
},
methods: {
handleChange1 (e) {
if (e) {
this._getBillNoInfo(e)
}
},
handleDel1 () {
this.pkId = ''
this.currentData = {}
this.index = ''
},
toSearch () {
if (this.code && this.currentData) {
this.show = true
} else {
uni.showToast({
title: '请扫码',
icon: 'none'
})
}
},
async _getBillNoInfo (e) {
try {
let res = await getBillNoInfo(e)
if (res && res.length) {
this.dataList = [...res]
this.pkId = ''
this.pkObj = {}
this.show = true
}
} catch (e) {}
},
toCheck (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code
this.currentData = this.pkId === e.material_code ? e : {}
},
confirmModal () {
this.show = false
this.code = this.currentData.code
this.val1 = this.currentData.qty
this.val2 = this.currentData.vehicle_code
if(this.currentData.stor_code !== '' && this.currentData.stor_code !== null && this.currentData.stor_code !== undefined) {
this.options.map(el => {
if (el.value === this.currentData.stor_code) {
this.index = el.value
}
})
} else {
if (this.currentData.vehicle_code.charAt(0).toUpperCase() === 'T') {
this.index ='FStockPallet'
} else {
this.index ='FStockId'
}
}
},
selectChange (e) {
this.index = e
},
async _storList () {
let res = await storList()
if (res.code === '200') {
this.options = [...res.content]
this.options.map(el => {
this.$set(el, 'text', el.label)
})
}
},
handleChange2 (e) {
if (e) {
if (e.charAt(0).toUpperCase() === 'T') {
this.index ='FStockPallet'
} else {
this.index ='FStockId'
}
}
},
handleDel2 () {
this.index = ''
},
toEmpty () {
this.code = ''
this.pkId = ''
this.currentData = {}
this.index = ''
this.val1 = null
this.val2 = null
this.disabled = false
},
async _inStorageConfirm () {
this.disabled = true
if (!this.val1 || !this.val2 || !this.index) {
this.disabled = false
return
}
try {
let obj = Object.assign(this.currentData, {qty: this.val1, vehicle_code: this.val2, stor_code: this.index})
let res = await inStorageConfirm(obj)
if (res.code === '200') {
this.toEmpty()
}
this.disabled = false
uni.showToast({
title: res.msg,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus" scoped>
.msg_wrapper
height: calc(100% - var(--status-bar-height) - 72rpx)
</style>

View File

@@ -41,7 +41,7 @@
return {
userName: '',
menuList: [
{title: '入库管理', path: 'RF01', sonTree: [{title: '物料组盘入库', path: '/pages/entry/mater-group-to-store'}, {title: '合格证入库', path: '/pages/entry/qualified-to-store'}, {title: '空托盘入库', path: '/pages/entry/empty-tray-to-store'}]},
{title: '入库管理', path: 'RF01', sonTree: [{title: '物料组盘入库', path: '/pages/entry/mater-group-to-store'}, {title: '合格证入库', path: '/pages/entry/qualified-to-store'}, {title: '单据入库', path: '/pages/entry/bill-to-store'}, {title: '空托盘入库', path: '/pages/entry/empty-tray-to-store'}]},
{title: '出库管理', path: 'RF02', sonTree: [{title: '空托盘出库', path: '/pages/outbound/tray-out-store'}, {title: '出库确认', path: '/pages/outbound/out-store-confirm'}, {title: '单据出库', path: '/pages/outbound/bill-list'}, {title: '库存出库', path: '/pages/outbound/stock-out-store'}]},
{title: '拣选管理', path: 'RF04', sonTree: [{title: '拣选作业', path: '/pages/pick/pick-task'}]},
{title: '设备操控', path: 'RF07', sonTree: [{title: '切换出入库模式', path: '/pages/mode/switch-in-out'}, {title: '拣选工位启停模式', path: '/pages/mode/pick'}, {title: '下发输送线运动命令', path: '/pages/mode/command'}]},

View File

@@ -28,13 +28,6 @@ export const storList = () => request({
url:'api/pda/common/storList',
data: {}
})
// export const storList = () => {
// let res = {
// code: '200',
// content: [{value: 'FicStockId', label: '虚拟库编码'}, {value: 'FStockId', label: '料箱编码'}, {value: 'FStockPallet', label: '托盘库编码'}]
// }
// return res
// }
export const groupMaterList = (page, size, search) => request({
url:'api/groupMater/maters',
data: {page: page, size: size, search: search}
@@ -253,4 +246,11 @@ export const getPointStatus = (scode) => request({
export const bindOrUnbind = (scode, bcode, mode) => request({
url:'api/point/bindOrUnbind',
data: {site_code: scode, shelf_code: bcode, mode: mode}
})
/**
* 单据入库
*/
export const getBillNoInfo = (id) => request({
url:'api/pda/inStorage/getBillNoInfo/' + id,
method: 'GET'
})

View File

@@ -263,4 +263,41 @@ export const queryTargetPoint = () => {
msg: '查询成功!'
}
return res
}
export const storList = () => {
let res = {
code: '200',
content: [{value: 'FicStockId', label: '虚拟库编码'}, {value: 'FStockId', label: '料箱编码'}, {value: 'FStockPallet', label: '托盘库编码'}]
}
return res
}
export const getBillNoInfo = (id) => {
let res = [
{
code: '订单号1',
material_code: '1',
material_name: 'material_name',
material_spec: 'material_spec',
unit_name: 'unit_name',
qty: '100',
stockOrgId: 'StockOrgId',
ownerId_id: 'OwnerId_Id',
single_weight: '500',
pcsn: 'pcsn',
vehicle_code: 'T001'
},
{
code: '订单号2',
material_code: '2',
material_name: 'material_name',
material_spec: 'material_spec',
unit_name: 'unit_name',
qty: '100',
stockOrgId: 'StockOrgId',
ownerId_id: 'OwnerId_Id',
single_weight: '500',
pcsn: 'pcsn'
}
]
return res
}