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

bug 修改, 优化

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