无出库单出库功能调整,版本更新至2.1.5

This commit is contained in:
赵正易 2024-04-28 10:40:58 +08:00
parent 4fd9d9638b
commit 64deb91da0
5 changed files with 296 additions and 275 deletions

View File

@ -2,8 +2,8 @@
"name" : "干巷仓库APP",
"appid" : "__UNI__A67E78B",
"description" : "",
"versionName" : "2.1.4",
"versionCode" : 214,
"versionName" : "2.1.5",
"versionCode" : 215,
"transformPx" : false,
"app-plus" : {
"usingComponents" : true,

View File

@ -83,9 +83,9 @@
}
},
{
"path": "pages/returnWarehose/returnWarehose",
"path": "pages/returnWarehouse/returnWarehouse",
"style": {
"navigationBarTitleText": "退库",
"navigationBarTitleText": "无出库单出库",
"enablePullDownRefresh": false
}
},

View File

@ -16,7 +16,7 @@
</u-grid-item>
</u-grid>
<u-gap height="20"></u-gap>
<u--text text="库存操作" size="36" bold></u--text>
<u--text text="库存管理" size="36" bold></u--text>
<u-grid :border="false" @click="gridCheck" col="4">
<u-grid-item v-if="item.type === 3" v-for="(item,index) in gridItemList" :key="index" :name="item.url">
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="item.icon" :size="128"></u-icon>
@ -24,7 +24,7 @@
</u-grid-item>
</u-grid>
<u-gap height="20"></u-gap>
<u--text text="库内操作" size="36" bold></u--text>
<u--text text="库内管理" size="36" bold></u--text>
<u-grid :border="false" @click="gridCheck" col="4">
<u-grid-item v-if="item.type === 4" v-for="(item,index) in gridItemList" :key="index" :name="item.url">
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="item.icon" :size="128"></u-icon>
@ -84,6 +84,13 @@
type: 2,
index: 5
},
{
name: '无出库单出库',
icon: 'grid-fill',
url: '/pages/returnWarehouse/returnWarehouse',
type: 2,
index: 15
},
{
name: '出货',
icon: 'grid-fill',

View File

@ -1,269 +0,0 @@
<template>
<view class="content">
<view class="title-box">
<!-- <span class="title-text">退库</span> -->
<view class="warehoseInfo-box">
<!-- <view>仓库编号{{ warehouseInfo.warehouse + ' ' + warehouseInfo.location }}</view>
<view class="row">
<view class="col">层号{{ warehouseInfo.layer }}</view>
<view class="col">货架{{ warehouseInfo.shelf }}</view>
</view>
<view>当前录入总货物数{{ quantityTotal }}</view> -->
<view>
<!-- <view v-if="searchType === 1" class="color1 aciton-box">操作指示-请扫仓库码</view> -->
<view v-if="searchType === 4" class="color2 aciton-box">退库操作指示-请扫货物码</view>
<!-- 扫描操作 -->
<view class="pda-search-box">
<PdaScanInput @getInfo="handleGetInfo" :type="searchType"></PdaScanInput>
</view>
</view>
</view>
</view>
<!-- 货物列表 -->
<view class="scroll-view-box">
<view class="scroll-view-title">退库清单</view>
<packageCard v-if="newMaterialList.length > 0" :packageInfo="newMaterialList[newMaterialList.length - 1]"></packageCard>
</view>
<!-- 底部按钮 -->
<view class="button-box">
<button type="default" @click="handlerSubmit">退库</button>
</view>
</view>
</template>
<script>
import materialItem from '@/components/material-item/material-item.vue';
import packageCard from '@/components/package-card/package-card.vue';
import * as WarehoseApi from '@/api/warehouse/warehose.js';
//
export default {
components: {
materialItem,
packageCard
},
data() {
return {
loading: false,
//
touchNum: 0,
clearData: {},
//
warehouseInfo: {
id: '',
warehouse: '',
warehouse_num: '',
location: '',
shelf: '',
layer: '',
number: 0
},
//
lastPackageInfo: {
//
workoderID: '',
// (++)
patchCode: '',
//
partNumner: '',
//
productionDescribe: '',
// /
productionTime: '',
//
quantity: 0
},
//
oldMaterialList: [],
//
newMaterialList: [],
// 4-退
searchType: 4
};
},
watch: {},
created() {
this.init();
},
computed: {
quantityTotal() {
let num = 0;
for (let index = 0; index < this.newMaterialList.length; index++) {
num += this.newMaterialList[index].quantity * 1;
}
return num;
}
},
methods: {
init() {
// [](35233201041) () +(BNW240312023_18B1)
//
this.clearData.warehouseInfo = JSON.parse(JSON.stringify(this.warehouseInfo));
this.clearData.oldMaterialList = JSON.parse(JSON.stringify(this.oldMaterialList));
this.clearData.newMaterialList = JSON.parse(JSON.stringify(this.newMaterialList));
this.searchType = 4;
},
clear() {
this.warehouseInfo = JSON.parse(JSON.stringify(this.clearData.warehouseInfo));
this.oldMaterialList = JSON.parse(JSON.stringify(this.clearData.oldMaterialList));
this.newMaterialList = JSON.parse(JSON.stringify(this.clearData.newMaterialList));
this.searchType = 4;
},
handleGetInfo(data, type) {
if (type === 4) {
//
//
const checkData = {
originalCode: data.originalCode
};
WarehoseApi.isExistedWarehouse(checkData).then((res) => {
if (this.newMaterialList.length > 0) {
uni.showModal({
title: '提示',
content: '退库只可退一个货物!',
showCancel: false,
confirmText: '确定'
});
return;
}
this.newMaterialList.push(data);
});
}
},
// 退
handlerSubmit() {
if (this.newMaterialList.length === 0) {
uni.showModal({
title: '提示',
content: '无退库货物!',
showCancel: false,
confirmText: '确定'
});
return;
}
uni.showModal({
title: '退库操作',
content: '是否确认执行退库操作?',
showCancel: true,
cancelText: '取消',
confirmText: '确认退库',
success: (res) => {
if (res.confirm) {
let list = [];
for (let item of this.newMaterialList) {
list.push(item.originalCode);
}
const data = {
originalCode: list[0]
};
WarehoseApi.handlErexitwarehouse(data).then((res) => {
if (res.code === 200) {
if (!res.data) {
uni.showModal({
title: '提示',
content: '退库异常:' + res.msg,
showCancel: false,
confirmText: '确定'
});
return;
}
uni.showToast({
icon: 'success',
title: '退库成功!'
});
this.clear();
} else {
uni.showToast({
icon: 'error',
title: '退库失败!'
});
}
});
}
}
});
}
}
};
</script>
<style scoped>
.title-box {
margin-top: 54px;
margin-bottom: 20px;
height: 60px;
font-size: 26px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.warehoseInfo-box {
font-size: 20px;
width: 94%;
margin: 0 auto;
padding-left: 10px;
padding-right: 10px;
background-color: aliceblue;
border-radius: 10px;
display: flex;
flex-direction: column;
}
.warehoseInfo-box .row {
display: flex;
flex-direction: row;
}
.warehoseInfo-box .row .col {
width: 50%;
}
.aciton-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.color1 {
color: brown;
}
.color2 {
color: orange;
}
.pda-search-box {
margin-bottom: 5px;
}
.list-box {
width: 100%;
}
.scroll-view-title {
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.scroll-view-box {
width: 94%;
margin: 0 auto;
margin-top: 20px;
height: 360px;
padding: 10px;
background-color: rgba(179, 179, 179, 0.7);
border-radius: 5px;
}
.scroll-view-last {
width: 100%;
height: 60px;
font-size: 20px;
color: rgba(0, 9, 0, 0.7);
display: flex;
flex-direction: column;
justify-content: center;
margin-top: 10px;
padding-left: 10px;
padding-right: 10px;
border-radius: 10px;
background-color: white;
}
.button-box {
width: 80%;
margin: 10px auto;
}
</style>

View File

@ -0,0 +1,283 @@
<template>
<view class="content">
<view class="title-box">
<!-- <span class="title-text">退库</span> -->
<view class="warehoseInfo-box">
<!-- <view>仓库编号{{ warehouseInfo.warehouse + ' ' + warehouseInfo.location }}</view>
<view class="row">
<view class="col">层号{{ warehouseInfo.layer }}</view>
<view class="col">货架{{ warehouseInfo.shelf }}</view>
</view>
<view>当前录入总货物数{{ quantityTotal }}</view> -->
<view>
<!-- <view v-if="searchType === 1" class="color1 aciton-box">操作指示-请扫仓库码</view> -->
<view v-if="searchType === 4" class="color2 aciton-box">请扫货物码</view>
<u--text type="error" size="26" text="请注意,此出库不追溯客户信息,无出库限制,只做出库操作!"></u--text>
<!-- 扫描操作 -->
<view class="pda-search-box">
<PdaScanInput @getInfo="handleGetInfo" :type="searchType"></PdaScanInput>
</view>
</view>
</view>
</view>
<!-- 货物列表 -->
<view class="scroll-view-box">
<view class="scroll-view-title">出库退库清单</view>
<packageCard v-if="newMaterialList.length > 0" :packageInfo="newMaterialList[newMaterialList.length - 1]">
</packageCard>
</view>
<!-- 底部按钮 -->
<view class="button-box">
<u-button style="width: 90%" type="primary" @click="handlerSubmit">无出库单出库</u-button>
</view>
</view>
</template>
<script>
import materialItem from '@/components/material-item/material-item.vue';
import packageCard from '@/components/package-card/package-card.vue';
import * as WarehoseApi from '@/api/warehouse/warehose.js';
//
export default {
components: {
materialItem,
packageCard
},
data() {
return {
loading: false,
//
touchNum: 0,
clearData: {},
//
warehouseInfo: {
id: '',
warehouse: '',
warehouse_num: '',
location: '',
shelf: '',
layer: '',
number: 0
},
//
lastPackageInfo: {
//
workoderID: '',
// (++)
patchCode: '',
//
partNumner: '',
//
productionDescribe: '',
// /
productionTime: '',
//
quantity: 0
},
//
oldMaterialList: [],
//
newMaterialList: [],
// 4-退
searchType: 4
};
},
watch: {},
created() {
this.init();
},
computed: {
quantityTotal() {
let num = 0;
for (let index = 0; index < this.newMaterialList.length; index++) {
num += this.newMaterialList[index].quantity * 1;
}
return num;
}
},
methods: {
init() {
// [](35233201041) () +(BNW240312023_18B1)
//
this.clearData.warehouseInfo = JSON.parse(JSON.stringify(this.warehouseInfo));
this.clearData.oldMaterialList = JSON.parse(JSON.stringify(this.oldMaterialList));
this.clearData.newMaterialList = JSON.parse(JSON.stringify(this.newMaterialList));
this.searchType = 4;
},
clear() {
this.warehouseInfo = JSON.parse(JSON.stringify(this.clearData.warehouseInfo));
this.oldMaterialList = JSON.parse(JSON.stringify(this.clearData.oldMaterialList));
this.newMaterialList = JSON.parse(JSON.stringify(this.clearData.newMaterialList));
this.searchType = 4;
},
handleGetInfo(data, type) {
if (type === 4) {
//
//
const checkData = {
originalCode: data.originalCode
};
WarehoseApi.isExistedWarehouse(checkData).then((res) => {
if (this.newMaterialList.length > 0) {
uni.showModal({
title: '提示',
content: '退库只可退一个货物!',
showCancel: false,
confirmText: '确定'
});
return;
}
this.newMaterialList.push(data);
});
}
},
// 退
handlerSubmit() {
if (this.newMaterialList.length === 0) {
uni.showModal({
title: '提示',
content: '无退库货物!',
showCancel: false,
confirmText: '确定'
});
return;
}
uni.showModal({
title: '退库操作',
content: '是否确认执行退库操作?',
showCancel: true,
cancelText: '取消',
confirmText: '确认退库',
success: (res) => {
if (res.confirm) {
let list = [];
for (let item of this.newMaterialList) {
list.push(item.originalCode);
}
const data = {
originalCode: list[0]
};
WarehoseApi.handlErexitwarehouse(data).then((res) => {
if (res.code === 200) {
if (!res.data) {
uni.showModal({
title: '提示',
content: '退库异常:' + res.msg,
showCancel: false,
confirmText: '确定'
});
return;
}
uni.showToast({
icon: 'success',
title: '退库成功!'
});
this.clear();
} else {
uni.showToast({
icon: 'error',
title: '退库失败!'
});
}
});
}
}
});
}
}
};
</script>
<style scoped>
.title-box {
margin-top: 54px;
margin-bottom: 20px;
height: 60px;
font-size: 26px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.warehoseInfo-box {
font-size: 20px;
width: 94%;
margin: 0 auto;
padding-left: 10px;
padding-right: 10px;
background-color: aliceblue;
border-radius: 10px;
display: flex;
flex-direction: column;
}
.warehoseInfo-box .row {
display: flex;
flex-direction: row;
}
.warehoseInfo-box .row .col {
width: 50%;
}
.aciton-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.color1 {
color: brown;
}
.color2 {
color: orange;
}
.pda-search-box {
margin-bottom: 5px;
}
.list-box {
width: 100%;
}
.scroll-view-title {
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.scroll-view-box {
width: 94%;
margin: 0 auto;
margin-top: 20px;
height: 360px;
padding: 10px;
background-color: rgba(179, 179, 179, 0.7);
border-radius: 5px;
}
.scroll-view-last {
width: 100%;
height: 60px;
font-size: 20px;
color: rgba(0, 9, 0, 0.7);
display: flex;
flex-direction: column;
justify-content: center;
margin-top: 10px;
padding-left: 10px;
padding-right: 10px;
border-radius: 10px;
background-color: white;
}
.button-box {
width: 80%;
margin: 10px auto;
}
</style>