Commit eeaf1615 authored by 何远江's avatar 何远江

bug 修改, 优化

parent bc3edf4c
<template>
<view class="factoryBox">
<zxz-uni-data-select
filterable
v-model="warehouseCode"
dataKey="label"
placeholder="请选择库存地点"
dataValue="value"
:localdata="warehouseData"
@change="onWarehouseChange"
/>
</view>
<view class="factoryBox">
<zxz-uni-data-select filterable v-model="warehouseCode" dataKey="label" placeholder="请选择库存地点" dataValue="value"
:localdata="warehouseData" @change="onWarehouseChange" />
</view>
</template>
<script>
export default {
model: {
prop: "value",
event: "update",
},
props: {
value: {
type: String,
defualt: "",
},
},
data() {
return {
warehouseData: [],
};
},
computed: {
warehouseCode: {
get() {
return this.value;
},
set(v) {
this.$emit("update", v);
},
},
},
created() {
this.getDepotLists();
},
methods: {
onWarehouseChange(e) {
this.$emit("change", e);
},
getDepotLists() {
this.$u.api.sapApi
.sapDict({
FIELDNAME: "T001L",
})
.then((res) => {
if (res) {
// 过滤当前工厂下的库存地点
this.warehouseData = res
.filter((ele) => ele.WERKS == this.vuex_user_factory)
.map((item) => {
item.label = item.LGORT + "-" + item.LGOBE;
item.value = item.LGORT;
return item;
});
} else {
this.warehouseData = [];
}
});
},
},
};
export default {
model: {
prop: "value",
event: "update",
},
props: {
value: {
type: String,
default: "",
},
options: {
type: Array,
default: () => ([])
}
},
data() {
return {
warehouseData: [],
};
},
computed: {
warehouseCode: {
get() {
return this.value;
},
set(v) {
this.$emit("update", v);
},
},
},
created() {
this.getDepotLists();
},
methods: {
onWarehouseChange(e) {
this.$emit("change", e);
},
getDepotLists() {
this.$u.api.sapApi
.sapDict({
FIELDNAME: "T001L",
})
.then((res) => {
if (res) {
// 过滤当前工厂下的库存地点
this.warehouseData = res
.filter((ele) => ele.WERKS == this.vuex_user_factory)
.map((item) => {
item.label = item.LGORT + "-" + item.LGOBE;
item.value = item.LGORT;
return item;
})
this.warehouseData.unshift(...this.options)
} else {
this.warehouseData = [];
}
});
},
},
};
</script>
<style lang="scss">
.factoryBox {
padding: 10rpx 20rpx 0;
.factoryBox {
padding: 10rpx 20rpx 0;
.item-select {
margin-bottom: 20rpx;
}
}
</style>
.item-select {
margin-bottom: 20rpx;
}
}
</style>
......@@ -2,7 +2,7 @@
<view class="page">
<StickyNavBar>
<NavBar title="完工入库扫描"></NavBar>
<FactorySelect v-model="LGOBE" @change="actionSheetCallback" />
<FactorySelect v-model="LGOBE" @change="actionSheetCallback" :options="options" />
<!-- <view class="selectSheet">
<u-row >
......@@ -13,7 +13,7 @@
</u-row>
</view> -->
<view class="btn">
<uni-easyinput prefixIcon="search" class="topSearch" v-model="nlpla" focus placeholder="请扫描库位" @change="handleInputNlpla"></uni-easyinput>
<uni-easyinput v-if="vuex_user_factory !== '1010'" prefixIcon="search" class="topSearch" :disabled="nlplaDisabled" v-model="nlpla" focus placeholder="请扫描库位" @change="handleInputNlpla"></uni-easyinput>
<uni-easyinput
prefixIcon="search"
:disabled="isDisabled"
......@@ -65,6 +65,7 @@ export default {
show: true,
nlpla: '',
wxparams: '',
nlplaDisabled: false,
warehouseCode: '',
btnArr: [
{
......@@ -89,12 +90,18 @@ export default {
LGORT: '',
type: 'select',
border: true,
list:[]
list:[],
options: [{
WERKS: "1000",
LGORT: "S000",
LGOBE: "发运仓",
label: "S000-发运仓",
value: "S000",
},]
};
},
created() {
// this.getDepotLists();
// 二维码包含:10位物料号(右对齐不足补充为0)物料号12位生产单号(右对齐不足补充为0),
// 10位批次号(右对齐不足补充为0),8位数量(100000.0)(右对齐不足补充为0)
// this.getPlnr('006000000100100000000300000501001');
......@@ -103,29 +110,12 @@ export default {
totalNum(){
let num = 0;
this.goodsList.forEach((ele) => {
num += ele.quantity;
num += ele.totalQuantity;
});
return num
}
},
methods: {
getDepotLists() {
this.$u.api.sapApi
.sapDict({
FIELDNAME: 'T001L'
})
.then((res) => {
if (res) {
res.forEach((ele) => {
ele.text = ele.LGORT + "-" + ele.LGOBE;
});
this.depotLists = res;
console.log(this.depotLists, 'depotLists', res);
} else {
this.depotLists = [];
}
});
},
// 点击actionSheet回调
actionSheetCallback(item) {
this.LGORT = item?.LGORT || "";
......@@ -200,6 +190,7 @@ export default {
},
handleInputNlpla(e) {
console.log(`output->e`,e)
this.nlplaDisabled = !!e
},
reset(){
setTimeout(() => {
......@@ -211,29 +202,34 @@ export default {
getPlnr(qrcode) {
this.isDisabled = true;
this.isFocus = false
if(!this.nlpla){
if(!this.nlpla && this.vuex_user_factory !== '1010'){
this.$u.toast('请先扫描仓位');
this.reset()
return
}
// if(!this.nlpla){
// this.$u.toast('请先扫描仓位');
// this.reset()
// return
// }
this.$u.api.mesApi
.pdaFindPackageLinkInfo({
qrcode
})
.then((res) => {
if (res && res.code == 200) {
if (this.goodsList.some((item) => item.workorderNo !== res.data[0].workorderNo)) {
this.$u.toast('请扫描同一个工单');
this.reset()
return
}
// if (this.goodsList.some((item) => item.workorderNo !== res.data[0].workorderNo)) {
// this.$u.toast('请扫描同一个工单');
// this.reset()
// return
// }
if (this.goodsList.some((item) => item.qrcode === qrcode)) {
this.$u.toast('已经存在当前条码');
this.reset()
return
}
res.data.forEach(ele => {
ele.NLPLA = this.nlpla?.trim();
this.nlpla && (ele.NLPLA = this.nlpla?.trim())
});
this.list = this.list.concat(res.data)
......
......@@ -8,6 +8,7 @@
<view class="item">产品描述:{{ item.itemName }}</view>
<view class="item">入库仓位:{{ item.NLPLA }}</view>
<view class="item">入库数量:{{ item.quantity }}</view>
<view class="item">loss数量:{{ item.lossNum }}</view>
</view>
<u-button size="mini" type="primary" plain @click="deleGonds(idx)">
<u-icon name="trash" size="28"></u-icon>
......
......@@ -9,11 +9,6 @@
>{{ goodsInfo.KOSTL }} / {{ goodsInfo.KTEXT }}</view
>
</view>
<view class="checkedCase">
<checkbox-group @change="checkedChange">
<checkbox value="r1" :checked="checkedBox" />是否结案
</checkbox-group>
</view>
</view>
<view class="btn">
<uni-easyinput
......@@ -158,10 +153,12 @@ export default {
// 获取items
const items = this.goodsList.reduce((acc, cur) => {
acc.push(...cur.details.map(v => {
v.KOSTL = cur.KOSTL
return v
}));
acc.push(
...cur.details.map((v) => {
v.KOSTL = cur.KOSTL;
return v;
})
);
return acc;
}, []);
......@@ -170,7 +167,7 @@ export default {
BUDAT: parseTime(new Date(), "{y}{m}{d}"),
zencode: "A006",
ZMARK: "A001",
TYPE: 'FL',
TYPE: "FL",
item: items,
};
this.$u.api.sapApi.sapRrm([params]).then((res) => {
......@@ -183,8 +180,17 @@ export default {
return this.$u.toast(errObj.MESSAGE);
}
// 提交成功 返回上一个页面
this.$u.toast("提交成功!");
this.goBack();
this.$u.toast("提交成功!", 3000, {
icon: "success",
mask: true,
complete: () => {
setTimeout(() => {
uni.navigateBack({
delta: 1,
});
}, 3000);
},
});
});
},
......@@ -231,10 +237,9 @@ export default {
let bdmng = 0;
// 查询需求数量与pl数量总和不等的物料
const item = items.find((v) => {
const total = v.details.length ? v.details.reduce(
(acc, cur) => (acc + +cur.ERFMG).toFixed(3),
0
) : 0
const total = v.details.length
? v.details.reduce((acc, cur) => (acc + +cur.ERFMG).toFixed(3), 0)
: 0;
bdmng = (v.BDMNG - total).toFixed(3);
return bdmng > 0;
});
......@@ -246,7 +251,7 @@ export default {
splitBlpl.ERFMG = bdmng;
blpl.ERFMG = (blpl.ERFMG - bdmng).toFixed(3);
}
splitBlpl.PACMG = splitBlpl.ERFMG
splitBlpl.PACMG = splitBlpl.ERFMG;
item.details.push(splitBlpl);
}
} else {
......
This diff is collapsed.
......@@ -2,6 +2,7 @@
<view>
<view class="listItemTitle">
<view>
<view class="item">交货单:{{ item.VBELN }}</view>
<view class="item">行号:{{ item.POSNR }}</view>
<view class="item">物料编号:{{ item.MATNR }}</view>
<view class="item">物料描述:{{ item.MAKTX }}</view>
......@@ -33,20 +34,18 @@
</view>
<view v-if="!show" class="bottomBox">
<view class="bottomItem" v-for="(ele, idx) in list" :key="ele.PLNR+idx" v-if="ele.ZSIZE === item.ZSIZE && ele.MATNR === item.MATNR && ele.PLNR">
<view class="items" v-if="ele.ZCODE">BL号:{{ ele.ZCODE }}</view>
<view class="items">PL号:{{ ele.PLNR }}</view>
<view class="items">物料批号:{{ ele.CHARG }}</view>
<view class="items">库位:{{ ele.LGORT }} - {{ ele.LGOBE }}</view>
<view class="items">仓位:{{ ele.NLPLA }}</view>
<!-- <view class="items">{{ ele.MATNR }}</view> -->
<view class="items inputItem">
<!-- <u-row gutter="8"> -->
数量:
{{ele.PACMG}}
<!-- <uni-easyinput v-model="ele.CLABS"></uni-easyinput> -->
<!-- /
{{ ele.LFIMG }} -->
<!-- </u-row> -->
</view>
<view class="items inputItem">数量:{{ele.PACMG}}</view>
<view class="boxBtn">
<u-button class="botBtn" size="mini" type="primary" plain @click="deleGonds(idx)">
<u-icon name="trash" size="28"></u-icon>
删除
</u-button>
</view>
</view>
</view>
</view>
......@@ -105,6 +104,9 @@ export default {
},
methods: {
deleGonds(idx) {
this.$emit('deleGonds', idx);
},
handleNum(){
let num = 0
this.list.forEach(ele => {
......@@ -205,6 +207,7 @@ page {
background: #f8f8f8;
padding: 20rpx;
margin-bottom: 20rpx;
position: relative;
.items {
color: #333;
font-size: 24rpx;
......@@ -224,6 +227,11 @@ page {
top: 0 !important;
background: #fff;
}
.boxBtn {
position: absolute;
bottom: 10rpx;
right: 10rpx;
}
.checkedBox{
text-align: right;
}
......
This diff is collapsed.
function toast(title, duration = 3000) {
function toast(title, duration = 3000, params) {
uni.showToast({
title: title,
icon: 'none',
duration: duration
duration: duration,
...params
})
}
......
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