Commit 572b25a1 authored by xiangzj's avatar xiangzj

生产发料

parent e529eab7
......@@ -36,6 +36,22 @@ const install = (Vue, vm) => {
sapPlnr: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/get_mm_plnr/plnr?sap-client=300', params,),
// 仓位转移
sapDict: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/ep_dict?sap-client=300', params),
// 生产领料
sapProiss: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_plto_proiss?sap-client=300', params),
// 完工入库
sapOrder: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/PDA_MES_Order/PDA_ORDER?sap-client=300', params),
// 线边库转移下架
sapXbkzy: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_plto_xbkzy?sap-client=300', params),
// 销售拣货单号查询
sapSchDn: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/search/sch_dn?sap-client=300', params),
// 销售拣货单
sapPickingDn: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/picking_dn?sap-client=300', params),
// 销售拣货过账
sapDelv: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/post_delv?sap-client=300', params),
// 销售拣货查询bl pl
sapBlpl: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/search/sch_BLPL?sap-client=300', params),
// 查询仓位
sapLgpla: (params = {}) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/search/sch_LGPLA?sap-client=300', params),
},
mesApi:{
//生产领料
......
<template>
<view>
<StickyNavBar>
<NavBar title="销售拣货单号"></NavBar>
<NavBar title="生产发料单号"></NavBar>
</StickyNavBar>
<ContentLoadingMore class="cardbox" :loadmore='true'>
<ContentLoadingMore class="cardbox" :loadmore='true' :status="status">
<view class="cardContent" v-for="(item, index) in goodsList">
<view class="listItemTitle" @click="handleClick(item)">
<view>
<view class="item">申请单号:{{ item.applyNo }}</view>
<view class="item">物料编号:{{ item.itemCode }}</view>
<view class="item">物料描述:{{ item.itemName }}</view>
<view class="item">工作中心:{{ item.workstationName }}</view>
<view class="item">备料状态:{{ item.grantNum? '配货中' : '未配货' }}</view>
<view class="item">计划时间:{{ item.startTime }}</view>
</view>
</view>
<view class="listBottom">
<!-- <view class="listBottom">
<view class="bottomTitle" @tap="show = !show">
<view class="desc">卷条码明细</view>
<view class="topIcons">
......@@ -33,7 +38,7 @@
<view class="items">生产日期:{{ item.BLDAT }}</view>
</view>
</view>
</view>
</view> -->
</view>
</ContentLoadingMore>
<!-- <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> -->
......@@ -72,6 +77,12 @@ export default {
}
],
goodsList: [],
pagination: {
pageNum:1,
pageSize:10,
},
total: 0,
status: 'loadmore'
};
},
created() {
......@@ -81,10 +92,18 @@ export default {
// 加载更多
onReachBottom() {
console.log('加载更多');
if(this.pagination.pageNum * this.pagination.pageSize >= this.total){
this.status = "noMore"
return;
}else{
this.status = "loading"
this.pagination.pageNum++
this.getPlnr();
}
},
handleClick(item){
uni.navigateTo({
url: `/pages/productionIssuance/productionIssuanceList?order=${JSON.stringify(item)}`
url: `/pages/productionIssuance/productionIssuanceList?order=${JSON.stringify([item])}`
});
},
getBtnHandle(row) {
......@@ -136,18 +155,18 @@ export default {
// e&& e.length > 79 && this.getPlnr(e);
e && this.getPlnr(e);
},
getPlnr(applyNo) {
getPlnr(applyNo = '') {
this.totalNum = 0;
this.isDisabled = true;
this.$u.api.mesApi
.pdaMaterialcreate({
pageNum:1,
pageSize:10,
...this.pagination,
applyNo
})
.then((res) => {
if (res.code - 200 === 0) {
this.goodsList = this.goodsList.concat(res.data);
this.goodsList = this.goodsList.concat(res.rows);
this.total = res.total
} else {
this.$u.toast(res.msg);
}
......
......@@ -69,13 +69,13 @@ export default {
way: 'goClick'
}
],
goodsList: [{}],
goodsList: [],
isFocus: false,
isDisabled: false
};
},
created() {
this.getPlnr('SN202400058');
this.getPlnr('SN202400172');
},
methods: {
getBtnHandle(row) {
......@@ -107,15 +107,47 @@ export default {
.then((res) => {
console.log(res,'-=')
if (res.code - 200 === 0) {
this.goodsList = this.goodsList.concat(res.data);
setTimeout(() => {
this.wxparams = '';
this.isFocus = true;
this.isDisabled = false;
}, 1000);
uni.navigateTo({
url: `/pages/productionIssuance/productionIssuanceList?order=${JSON.stringify(this.goodsList)}`
url: `/pages/productionIssuance/productionIssuanceList?order=${applyNo}`
});
// const data = res.rows
// data.forEach((ele,index) => {
// ele.sonItemCode = []
// ele.sonItemCode.push(...data)
// })
// const result = data.filter((item, index, self) => {
// return self.findIndex(t => t.itemCode === item.itemCode) === index;
// });
// let i=null,j=null
// for(i = 0; i < result.length; i++){
// for(j = 0; j < result[i].sonItemCode.length; j++){
// if(result[i].itemCode !== result[i].sonItemCode[j].itemCode){
// result[i].sonItemCode.splice(j,1)
// j--
// }
// }
// }
// console.log(result)
// setTimeout(() => {
// this.wxparams = '';
// this.isFocus = true;
// this.isDisabled = false;
// }, 1000);
// uni.navigateTo({
// url: `/pages/productionIssuance/productionIssuanceList?order=${JSON.stringify(result)}`
// });
// console.log(result)
// this.goodsList = this.goodsList.concat(res.rows);
// setTimeout(() => {
// this.wxparams = '';
// this.isFocus = true;
// this.isDisabled = false;
// }, 1000);
// console.log(this.goodsList)
// uni.navigateTo({
// url: `/pages/productionIssuance/productionIssuanceList?order=${JSON.stringify(this.goodsList)}`
// });
} else {
setTimeout(() => {
this.isFocus = true;
......
This diff is collapsed.
<template>
<view>
<view class="listItemTitle">
<view>
<view class="item">物料编号:{{ item.itemCode }}</view>
<view class="item">物料描述:{{ item.itemName }}</view>
</view>
<view class="right">
<text class="blue">{{totalVistaNum}}</text>
<text class="line">/</text>
<text class="">{{totalNum}}</text>
</view>
</view>
<view class="listBottom">
<view class="bottomTitle" @click="show = !show">
<view class="desc">卷条码明细</view>
<view class="topIcons">
<view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开
</view>
<view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起
</view>
</view>
</view>
<view v-if="!show" class="bottomBox">
<view class="bottomItem" v-for="(ele, idx) in list" :key="ele.workorderCode+idx" v-if="ele.itemCode === item.itemCode">
<view class="items">生产单号:{{ ele.applyNo }}</view>
<view class="items">物料批次:{{ ele.charg }}</view>
<!-- <view class="items">库位:{{ item.MATNR }}</view> -->
<!-- <view class="items">{{ item.MATNR }}</view> -->
<view class="items inputItem">
数量:
<!-- <uni-easyinput v-model="item.vista"></uni-easyinput> -->
{{ele.vista}}
/
{{ ele.applyNum }}
</view>
</view>
</view>
</view>
<!-- <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> -->
</view>
</template>
<script>
import StickyNavBar from '@/components/StickyNavBar/index.vue';
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue';
import BottomBtn from '@/components/BottomBtn/index.vue';
export default {
components: {
StickyNavBar,
ContentLoadingMore,
BottomBtn
},
props: {
item: {
type: Object,
default: function () {
return {};
}
},
list: {
type: Array,
default: function () {
return [];
}
}
},
computed:{
totalNum(){
let num = 0
this.list.forEach(ele => {
if(ele.itemCode === this.item.itemCode && !ele.add){
num += ele.applyNum
}
});
return num
},
totalVistaNum(){
let num = 0
this.list.forEach(ele => {
if(ele.itemCode === this.item.itemCode){
num += ele.vista
}
});
return num || ''
},
},
// watch: {
// goodsList: {
// handler: function(val, oldVal) {
// this.goodsList = val
// },
// immediate: true
// }
// },
data() {
return {
number: 0,
nlpla: '',
wxparams: '',
btnArr: [
{
style: '',
type: 'warning',
text: '返回',
way: 'goBack'
},
{
style: '',
type: 'primary',
text: '提交',
way: 'goSubmit'
}
],
isFocus: false,
show: true,
num1: 0
};
},
created() {
},
methods: {
}
};
</script>
<style lang="scss" scoped>
page {
background: #f8f8f8;
}
.headerTitle {
padding: 20rpx;
font-weight: 600;
.items {
line-height: 40rpx;
}
}
.btn {
padding: 20rpx;
background: #fff;
.topSearch {
margin-bottom: 20rpx;
}
}
.bottomBtn {
position: sticky;
padding: 20rpx;
display: flex;
justify-content: space-between;
background: #fff;
bottom: 0rpx;
margin-top: 20rpx;
.u-btn {
width: 300rpx;
}
}
.blue {
color: #3f9dcc;
}
.total {
background: #fff;
color: #000;
padding: 0rpx 40rpx;
display: flex;
justify-content: space-between;
font-size: 32rpx;
.line {
margin: 0px 10rpx;
}
}
.listItemTitle {
display: flex;
justify-content: space-between;
padding: 20rpx;
border-bottom: 2px solid #f8f8f8;
.u-btn {
width: 150rpx;
margin: 0px;
margin-top: 10rpx;
}
.item {
line-height: 50rpx;
color: #333;
font-size: 28rpx;
font-weight: 500;
word-break: break-all;
font-weight: 600;
}
}
.listBottom {
.bottomTitle {
height: 80rpx;
position: relative;
.desc {
color: #bbb;
font-size: 24rpx;
line-height: 80rpx;
padding-left: 20rpx;
}
.topIcons {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: #aaa;
}
}
.bottomBox {
padding: 20rpx;
.bottomItem {
background: #f8f8f8;
padding: 20rpx;
margin-bottom: 20rpx;
.items {
color: #333;
font-size: 24rpx;
line-height: 40rpx;
/deep/ .uni-easyinput{
width: 200rpx;
}
}
.inputItem{
display: inline-flex;
// line-height: 76rpx;
}
}
}
}
/deep/ .u-sticky {
top: 0 !important;
}
</style>
......@@ -51,7 +51,6 @@ export default {
return {
bgSrc: require('@/static/images/qrcode.png'),
number: 0,
totalNum: 0,
show: true,
nlpla: '',
wxparams: '',
......@@ -75,16 +74,9 @@ export default {
};
},
created() {
// this.getPlnr('10000820240325000001|10000320100');
// this.getPlnr('10000001');
},
methods: {
deleGonds(idx) {
this.goodsList.splice(idx, 1);
this.totalNum = 0;
this.goodsList.forEach((ele) => {
this.totalNum += ele.ERFMG;
});
},
getBtnHandle(row) {
this[row.way]();
},
......@@ -103,43 +95,21 @@ export default {
this.isFocus = false;
e && this.getPlnr(e);
},
handleInputNlpla(e) {
if (e) {
this.nlpla = e;
this.goodsList.forEach((ele) => {
this.totalNum += ele.ERFMG;
ele.NLPLA = ele.NLPLA || this.nlpla;
});
}
},
getPlnr(plnr) {
this.totalNum = 0;
this.isDisabled = true;
getPlnr(VBELN) {
this.$u.api.sapApi
.sapPlnr({
plnr
.sapSchDn({
VBELN
})
.then((res) => {
if (res.RESULT.TYPE === 'S') {
this.goodsList = this.goodsList.concat(res.DATA);
this.goodsList.forEach((ele) => {
this.totalNum += ele.ERFMG;
ele.NLPLA = ele.NLPLA || this.nlpla;
});
setTimeout(() => {
this.wxparams = '';
this.isFocus = true;
this.isDisabled = false;
}, 1000);
if (res.BKDT.length) {
this.goodsList = res.BKDT
uni.navigateTo({
url: `/pages/salesOutbound/salesOutboundList`
url: `/pages/salesOutbound/salesOutboundList?order=${JSON.stringify(this.goodsList)}`
});
} else {
setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
}, 1000);
this.$u.toast(res.RESULT.MESSAGE);
// res.forEach(element => {
// });
this.$u.toast(res.MSG[0].MESSAGE);
}
this.loading = false;
});
......
......@@ -26,16 +26,16 @@
<view class="left">物料明细</view>
<view class="right">
物料数量:
<text class="blue">{{ goodsList.length }}</text>
<text class="blue">{{ totalNum }}</text>
<text class="line">/</text>
<text class="">{{ totalNum }}</text>
<text class="">{{ goodsList.length }}</text>
</view>
</view>
</view>
</StickyNavBar>
<ContentLoadingMore class="contentMore">
<view class="cardbox">
<view class="cardContent" v-for="(item, index) in goodsList">
<view class="cardContent" v-for="(item, index) in goodsList" :key="item.MATNR">
<scanningList :item='item'/>
</view>
</view>
......@@ -106,11 +106,10 @@ export default {
},
onLoad(option) {
if(option && option.order){
this.orderItem = {
this.goodsList = [
...JSON.parse(option.order)
]
}
}
},
methods: {
goSubmit() {
......@@ -118,15 +117,7 @@ export default {
return;
}
this.$u.api.sapApi
.sapRrm([
{
BLDAT: '20240325',
BUDAT: '20240325',
ZENCODE: 'A014',
// TYPE: 'CG',
ITEM: this.goodsList
}
])
.sapPickingDn(this.goodsList)
.then((res) => {
this.loading = false;
console.log(res);
......@@ -146,30 +137,24 @@ export default {
},
getPlnr(plnr) {
this.totalNum = 0;
this.isDisabled = true;
this.$u.api.sapApi
.sapPlnr({
.sapBlpl({
ZCODE: '',
plnr
})
.then((res) => {
if (res.RESULT.TYPE === 'S') {
this.goodsList = this.goodsList.concat(res.DATA);
this.goodsList.forEach((ele) => {
ele.show = false
this.totalNum += ele.ERFMG;
ele.NLPLA = ele.NLPLA || this.nlpla;
if (res.MSG[0].TYPE === 'S') {
const data = res.BLPL[0]
this.goodsList.forEach(ele => {
if(ele.MATNR === res.BLPL[0].MATNR){
ele.NLBER = data.NLBER
ele.NLPLA = data.NLPLA
ele.NLTYP = data.NLTYP
ele.CLABS = data.PACMG
}
});
setTimeout(() => {
this.wxparams = '';
this.isFocus = true;
this.isDisabled = false;
}, 1000);
} else {
setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
}, 1000);
this.$u.toast(res.RESULT.MESSAGE);
this.$u.toast(res.MSG[0].MESSAGE);
}
this.loading = false;
});
......
......@@ -6,9 +6,9 @@
<view class="item">物料描述:{{ item.MAKTX }}</view>
</view>
<view class="right">
<text class="blue">{{ item.ERFMG }}</text>
<text class="blue">{{ item.CLABS }}</text>
<text class="line">/</text>
<text class="">2000pcs</text>
<text class="">{{item.LFIMG}}pcs</text>
</view>
</view>
<view class="listBottom">
......@@ -27,16 +27,16 @@
</view>
<view v-if="!show" class="bottomBox">
<view class="bottomItem">
<view class="items">装箱号:{{ item.CHARG }}</view>
<view class="items">装箱号:{{ item.ZCODE }}</view>
<view class="items">物料批号:{{ item.CHARG }}</view>
<view class="items">库位:{{ item.MATNR }}</view>
<view class="items">库位:{{ item.LGORT }}</view>
<!-- <view class="items">{{ item.MATNR }}</view> -->
<view class="items inputItem">
<!-- <u-row gutter="8"> -->
数量:
<uni-easyinput v-model="wxparams"></uni-easyinput>
<uni-easyinput v-model="item.CLABS"></uni-easyinput>
/
{{ item.CHARG }}
{{ item.LFIMG }}
<!-- </u-row> -->
</view>
</view>
......@@ -93,7 +93,7 @@ export default {
}
],
isFocus: false,
show: false,
show: true,
};
},
......@@ -193,12 +193,12 @@ page {
color: #333;
font-size: 24rpx;
line-height: 40rpx;
display: inline-flex;
/deep/ .uni-easyinput{
width: 200rpx;
}
}
.inputItem{
display: inline-flex;
line-height: 76rpx;
}
}
......
......@@ -78,7 +78,7 @@ class Request {
let url= this.config.baseUrl
if(options.url.indexOf('sap') > -1){
// console.log('sap')
url = 'http://192.168.3.109:8000'
// url = 'http://192.168.3.109:8000'
options.header = {
...options.header,
'content-type': 'application/json;charset=UTF-8',
......@@ -89,10 +89,10 @@ class Request {
...options.header,
'content-type': 'application/json;charset=UTF-8',
}
url = 'http://192.168.3.91:8080'
// url = 'http://192.168.66.119:8080'
}else{
// console.log('mobile')
url = 'http://192.168.3.91:8080'
// url = 'http://192.168.3.91:8080'
}
// 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
options.url = validate.url(options.url) ? options.url : (url + (options.url.indexOf('/') == 0 ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment