add库存出库

This commit is contained in:
蔡玲
2024-12-13 16:37:09 +08:00
parent f78fd6ba03
commit 2657cf2c5f
9 changed files with 350 additions and 9 deletions

View File

@@ -256,6 +256,24 @@
}
}
,{
"path" : "pages/outbound/stock-out-store",
"style" :
{
"navigationStyle": "custom"
}
}
,{
"path" : "pages/outbound/stock-list",
"style" :
{
"navigationStyle": "custom",
"enablePullDownRefresh": true,
"onReachBottomDistance": 50
}
}
],
"globalStyle": {
// "pageOrientation": "landscape",

View File

@@ -6,7 +6,7 @@
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">载具码</span>
<span class="filter_label">载具</span>
</view>
<view class="zd-col-17">
<search-box

View File

@@ -42,7 +42,7 @@
userName: '',
menuList1: [
{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: 'RF02', sonTree: [{title: '托盘出库', path: '/pages/outbound/tray-out-store'}, {title: '出库确认', path: '/pages/outbound/out-store-confirm'}, {title: '单据出库', path: '/pages/outbound/bill-out-store'}]},
{title: '出库管理', path: 'RF02', sonTree: [{title: '托盘出库', path: '/pages/outbound/tray-out-store'}, {title: '出库确认', path: '/pages/outbound/out-store-confirm'}, {title: '单据出库', path: '/pages/outbound/bill-out-store'}, {title: '库存出库', path: '/pages/outbound/stock-out-store'}]},
{title: '在库管理', path: 'RF03', sonTree: [{title: '库存信息', active: false, path: '/pages/in/store-info'}]},
{title: '拣选管理', path: 'RF04', sonTree: [{title: '拣选作业', path: '/pages/pick/pick-task'}]},
{title: '盘点管理', path: 'RF05', sonTree: [{title: '盘点作业', path: '/pages/check/check-task'}]},
@@ -52,7 +52,7 @@
],
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: 'RF02', sonTree: [{title: '托盘出库', path: '/pages/outbound/tray-out-store'}, {title: '出库确认', path: '/pages/outbound/out-store-confirm'}, {title: '单据出库', path: '/pages/outbound/bill-out-store'}]},
{title: '出库管理', path: 'RF02', sonTree: [{title: '托盘出库', path: '/pages/outbound/tray-out-store'}, {title: '出库确认', path: '/pages/outbound/out-store-confirm'}, {title: '单据出库', path: '/pages/outbound/bill-out-store'}, {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'}]},
{title: '转运管理', path: 'RF09', sonTree: [{title: '托盘转运', path: '/pages/transfer/tray-transfer'}]}

View File

@@ -6,7 +6,7 @@
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">载具码</span>
<span class="filter_label">载具</span>
</view>
<view class="zd-col-24">
<search-box

View File

@@ -0,0 +1,149 @@
<template>
<view class="zd_container">
<!-- 库存出库 -->
<nav-bar :title="title" :inner="true"></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-24 filter_select">
<uni-data-select v-model="index" :localdata="options"></uni-data-select>
</view>
</view>
<view class="zd-row">
<view class="zd-col-7">
<span class="filter_label">物料编码</span>
</view>
<view class="zd-col-24 filter_select">
<input type="text" class="filter_input" v-model="val1">
</view>
</view>
</view>
<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>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.id === pkId}" @tap="toCheck(e)">
<td>{{e.stor_code}}</td>
<td>{{e.struct_code}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.qty}}</td>
</tr>
</tbody>
</table>
</view>
</view>
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-8 button-primary" @tap="searchList">查询</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {structattrPage} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
options: [{value: 'FStockPallet', text: '托盘库'}, {value: 'FStockId', text: '料箱库'}],
index: '',
dataList: [],
pkId: '',
pkObj: {},
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10
};
},
onLoad (options) {
this.title = options.title
},
methods: {
searchList () {
this.dataList = []
this.pageNum = 1
this._structattrPage()
},
async _structattrPage () {
let res = await structattrPage(this.pageNum + '', this.pageSize + '', this.index, this.val1, true)
if (res.code === '200') {
this.totalCount = res.totalElements
if (res.totalElements > 0) {
const dataMap = res.content
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
this.reload = false
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
}
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._structattrPage()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = this.pkId === e.id ? '' : e.id
this.pkObj = this.pkId === e.id ? e : {}
},
toEmpty () {
this.index = ''
this.val1 = ''
this.dataList = []
this.pageNum = 1
this.pkId = ''
},
toSure () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
uni.navigateBack()
}
}
}
}
</script>
<style lang="stylus" scoped>
</style>

View File

@@ -0,0 +1,129 @@
<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-24 filter_select">
<input type="text" class="filter_input" v-model="val1" @tap="toJump">
</view>
</view>
</view>
<view v-if="JSON.stringify(currentData) !== '{}'" class="zd_wrapper">
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-7"><span class="filter_label">库位</span></view>
<view class="zd-col-17"><span class="filter_input">{{currentData.struct_code}}</span></view>
</view>
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-7"><span class="filter_label">载具编码</span></view>
<view class="zd-col-17"><span class="filter_input">{{currentData.vehicle_code}}</span></view>
</view>
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-7"><span class="filter_label">物料编码</span></view>
<view class="zd-col-17"><span class="filter_input">{{currentData.material_code}}</span></view>
</view>
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-7"><span class="filter_label">批号</span></view>
<view class="zd-col-17"><span class="filter_input">{{currentData.pcsn}}</span></view>
</view>
<view class="zd-row">
<view class="zd-col-7"><span class="filter_label">车间</span></view>
<view class="zd-col-17 filter_select">
<uni-data-select v-model="currentData.product_area" :localdata="options1"></uni-data-select>
</view>
</view>
<view class="zd-row">
<view class="zd-col-7"><span class="filter_label">出库库存</span></view>
<view class="zd-col-17">
<input type="number" v-model="currentData.qty" class="filter_input">
</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': JSON.stringify(currentData) === '{}'}" :disabled="disabled" @tap="_outStorageMaterConfirm">出库确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {outStorageMaterConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
currentData: {},
options1: [{value: 'A1', text: 'A1车间'}, {value: 'A2', text: 'A2车间'}, {value: 'A3', text: 'A3车间'}],
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
onShow () {
if (this.$store.getters.publicObj !== '') {
this.currentData = this.$store.getters.publicObj
if (this.currentData.stor_code === 'FStockPallet') {
this.val1 = '托盘库'
} else if (this.currentData.stor_code === 'FStockId') {
this.val1 = '料箱库'
}
this.$store.dispatch('setPublicObj', '')
}
},
methods: {
toJump () {
uni.navigateTo({
url: '/pages/outbound/stock-list?title=库存列表'
})
},
async _outStorageMaterConfirm () {
this.disabled = true
if (JSON.stringify(this.currentData) === '{}') {
this.disabled = false
return
}
let obj = Object.assign(this.currentData, {now_assign_qty: this.currentData.qty})
try {
let res = await outStorageMaterConfirm(obj)
if (res.code === '200') {
this.toEmpty()
}
this.disabled = false
uni.showToast({
title: res.msg,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
toEmpty () {
this.val1 = ''
this.currentData = {}
this.disabled = false
}
}
}
</script>
<style lang="stylus" scoped>
@import '../../common/style/mixin.styl';
.button-primary, .button-default
_fj(center)
font-size 26rpx
height 88rpx
line-height 30rpx
</style>

View File

@@ -4,6 +4,16 @@
<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-24 filter_select">
<search-box
v-model="val2"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">起点</span>
@@ -27,7 +37,7 @@
</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 || !index}" :disabled="disabled" @tap="_transfConfirm">转运确认</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !index || !val2}" :disabled="disabled" @tap="_transfConfirm">转运确认</button>
</view>
</view>
</template>
@@ -47,6 +57,7 @@
val1: '',
options: [],
index: '',
val2: '',
disabled: false
};
},
@@ -65,12 +76,12 @@
},
async _transfConfirm () {
this.disabled = true
if (!this.val1 || !this.index) {
if (!this.val1 || !this.index || !this.val2) {
this.disabled = false
return
}
try {
let res = await transfConfirm(this.val1, this.index)
let res = await transfConfirm(this.val1, this.index, this.val2)
this.disabled = false
uni.showToast({
title: res.msg,

View File

@@ -203,7 +203,19 @@ export const deviceManageTransf = (start) => request({
url:'api/deviceManage/transf',
data: {start: start}
})
export const transfConfirm = (start, end) => request({
export const transfConfirm = (start, end, code) => request({
url:'api/deviceManage/transfConfirm',
data: {start: start, end: end}
data: {start: start, end: end, vehicle_code: code}
})
/**
* 库存出库
*/
export const structattrPage = (page, size, code, mcode, has) => request({
url:'api/structattr?page=' + page + '&size=' + size + '&stor_code=' + code + '&material_code=' + mcode + '&has=' + has,
method: 'GET'
})
export const outStorageMaterConfirm = (obj) => request({
url:'api/pda/outStorage/materConfirm',
data: obj
})

View File

@@ -214,4 +214,26 @@ export const outStorageOrderConfirm = (code) => {
export const deviceManageTransf = () => {
let res = [{value: '1109', text: '一楼楼入库点'}, {value: '2109', text: '二楼楼入库点'}]
return res
}
export const structattrPage = () => {
let res = {
"totalElements": 10,
"content": [
{
"id": '1',
"code": "PPBOM241102856",
"struct_code": "struct_code",
"product_area": "A1",
"vehicle_code": "vehicle_code",
"material_code": "04.01.DY.00531",
"qty": 0.0,
"pcsn": "批次",
"stor_code": "FStockPallet"
}
],
"data": {},
"code": "200",
"msg": ""
}
return res
}