Commit 1d7afeb1 authored by 何远江's avatar 何远江

bug 修改

parent 41c71ed6
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
<view class="page"> <view class="page">
<StickyNavBar> <StickyNavBar>
<NavBar title="完工入库扫描"></NavBar> <NavBar title="完工入库扫描"></NavBar>
<FactorySelect v-model="LGOBE" @change="actionSheetCallback" :options="options" /> <FactorySelect
v-model="LGOBE"
@change="actionSheetCallback"
:options="options"
/>
<!-- <view class="selectSheet"> <!-- <view class="selectSheet">
<u-row > <u-row >
...@@ -13,7 +17,16 @@ ...@@ -13,7 +17,16 @@
</u-row> </u-row>
</view> --> </view> -->
<view class="btn"> <view class="btn">
<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
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"
...@@ -36,7 +49,12 @@ ...@@ -36,7 +49,12 @@
</StickyNavBar> </StickyNavBar>
<ContentLoadingMore class="cardbox" :list="goodsList"> <ContentLoadingMore class="cardbox" :list="goodsList">
<view class="cardContent" v-for="(item, index) in goodsList"> <view class="cardContent" v-for="(item, index) in goodsList">
<scanningList :item='item' :idx="index" @deleGonds="deleGonds" :list='list'/> <scanningList
:item="item"
:idx="index"
@deleGonds="deleGonds"
:list="list"
/>
</view> </view>
</ContentLoadingMore> </ContentLoadingMore>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
...@@ -44,61 +62,61 @@ ...@@ -44,61 +62,61 @@
</template> </template>
<script> <script>
import StickyNavBar from '@/components/StickyNavBar/index.vue'; import StickyNavBar from "@/components/StickyNavBar/index.vue";
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue'; import ContentLoadingMore from "@/components/ContentLoadingMore/index.vue";
import BottomBtn from '@/components/BottomBtn/index.vue'; import BottomBtn from "@/components/BottomBtn/index.vue";
import { parseTime} from "@/utils/ruoyi"; import { parseTime } from "@/utils/ruoyi";
import scanningList from "./scanningList.vue" import scanningList from "./scanningList.vue";
import FactorySelect from '@/components/FactorySelect/FactorySelect.vue' import FactorySelect from "@/components/FactorySelect/FactorySelect.vue";
export default { export default {
components: { components: {
StickyNavBar, StickyNavBar,
ContentLoadingMore, ContentLoadingMore,
BottomBtn, BottomBtn,
scanningList scanningList,
}, },
data() { data() {
return { return {
number: 0, number: 0,
show: true, show: true,
nlpla: '', nlpla: "",
wxparams: '', wxparams: "",
nlplaDisabled: false, nlplaDisabled: false,
warehouseCode: '', warehouseCode: "",
btnArr: [ btnArr: [
{ {
style: '', style: "",
type: 'warning', type: "warning",
text: '返回', text: "返回",
way: 'goBack' way: "goBack",
}, },
{ {
style: '', style: "",
type: 'primary', type: "primary",
text: '提交', text: "提交",
way: 'goSubmit' way: "goSubmit",
} },
], ],
goodsList: [], goodsList: [],
isFocus: false, isFocus: false,
isDisabled: false, isDisabled: false,
depotShow: false, depotShow: false,
depotLists: [], depotLists: [],
LGOBE: '', LGOBE: "",
LGORT: '', LGORT: "",
type: 'select', type: "select",
border: true, border: true,
list:[], list: [],
options: [{ options: [
{
WERKS: "1000", WERKS: "1000",
LGORT: "S000", LGORT: "S000",
LGOBE: "发运仓", LGOBE: "发运仓",
label: "S000-发运仓", label: "S000-发运仓",
value: "S000", value: "S000",
},] },
],
}; };
}, },
created() { created() {
...@@ -106,14 +124,14 @@ export default { ...@@ -106,14 +124,14 @@ export default {
// 10位批次号(右对齐不足补充为0),8位数量(100000.0)(右对齐不足补充为0) // 10位批次号(右对齐不足补充为0),8位数量(100000.0)(右对齐不足补充为0)
// this.getPlnr('006000000100100000000300000501001'); // this.getPlnr('006000000100100000000300000501001');
}, },
computed:{ computed: {
totalNum(){ totalNum() {
let num = 0; let num = 0;
this.list.forEach((ele) => { this.list.forEach((ele) => {
num += ele.totalQuantity; num += ele.totalQuantity;
}); });
return num return num;
} },
}, },
methods: { methods: {
// 点击actionSheet回调 // 点击actionSheet回调
...@@ -122,7 +140,6 @@ export default { ...@@ -122,7 +140,6 @@ export default {
}, },
deleGonds(idx) { deleGonds(idx) {
this.goodsList.splice(idx, 1); this.goodsList.splice(idx, 1);
}, },
getBtnHandle(row) { getBtnHandle(row) {
this[row.way](); this[row.way]();
...@@ -131,56 +148,96 @@ export default { ...@@ -131,56 +148,96 @@ export default {
uni.navigateBack(); uni.navigateBack();
}, },
goSubmit() { goSubmit() {
if (this.goodsList.length === 0) { if (!this.goodsList.length) return;
return;
} let params = [];
let params = [] // this.list.forEach((ele) => {
let item = [] // item.push({
this.list.forEach(ele => { // AUFNR: ele.workorderNo,
item.push({ // PLNR: ele.qrcode,
AUFNR:ele.workorderNo, // MATNR: ele.sapItemCode,
PLNR: ele.qrcode, // WERKS: this.vuex_user_factory,
MATNR: ele.sapItemCode, // LGORT: this.LGORT,
// PACKNR: ele.qrcode,
// ZSIZE: ele.standardSize,
// ZINSTNUM: ele.clientCmd,
// BRGEW: ele.grossWeight,
// NTGEW: ele.netWeight,
// GEWEI: ele.unitOfMeasure,
// INSNAM: ele.checkBy,
// TOMNG: ele.totalQuantity,
// ZMNGO: ele.quantity,
// ZMNGL: ele.lossNum,
// NLPLA: ele.NLPLA,
// });
// });
const items = this.list.reduce(
(pre, cur) => {
pre.item.push({
AUFNR: cur.workorderNo,
PLNR: cur.qrcode,
MATNR: cur.sapItemCode,
WERKS: this.vuex_user_factory, WERKS: this.vuex_user_factory,
LGORT: this.LGORT, LGORT: this.LGORT,
PACKNR: ele.qrcode, PACKNR: cur.qrcode,
ZSIZE: ele.standardSize, ZSIZE: cur.standardSize,
ZINSTNUM: ele.clientCmd, ZINSTNUM: cur.clientCmd,
BRGEW: ele.grossWeight, BRGEW: cur.grossWeight,
NTGEW: ele.netWeight, NTGEW: cur.netWeight,
GEWEI: ele.unitOfMeasure, GEWEI: cur.unitOfMeasure,
INSNAM: ele.checkBy, INSNAM: cur.checkBy,
TOMNG: ele.totalQuantity, TOMNG: cur.totalQuantity,
ZMNGO: ele.quantity, ZMNGO: cur.quantity,
ZMNGL: ele.lossNum, ZMNGL: cur.lossNum,
NLPLA: ele.NLPLA, NLPLA: cur.NLPLA,
}) ZCODE: cur.blQrcode
}); });
if (pre.zcode.findIndex((v) => v.ZCODE == cur.blQrcode) == -1) {
pre.zcode.push({
ZCODE: cur.blQrcode,
ZXSPE: cur.packageStandard,
ZXVOLUM: cur.packVolume,
ZXNTGEW: cur.boxWeight,
NTGEW: cur.netWeight,
BRGEW: cur.grossWeight,
ZXTEXT: cur.remark,
KUNNR: cur.clientCode,
ZPRINT: cur.templateStandard,
ZPRNTDA: cur.printDate,
ZPRNTTI: cur.printTime,
ZPRNTER: cur.printBy,
UNAME: cur.createBy,
DATUM: cur.createDate,
UZEIT: cur.createTime,
});
}
return pre;
},
{ item: [], zcode: [] }
);
params.push({ params.push({
lfsnr: this.goodsList[0].workorderNo, lfsnr: this.goodsList[0].workorderNo,
// BLDAT: 20240420, // BLDAT: 20240420,
// BUDAT: 20240420, // BUDAT: 20240420,
BLDAT: parseTime(new Date(),'{y}{m}{d}'), BLDAT: parseTime(new Date(), "{y}{m}{d}"),
BUDAT: parseTime(new Date(),'{y}{m}{d}'), BUDAT: parseTime(new Date(), "{y}{m}{d}"),
item, ...items,
}) });
this.$u.api.sapApi this.$u.api.sapApi.sapOrder(params).then((res) => {
.sapOrder(params)
.then((res) => {
this.loading = false; this.loading = false;
if(!Array.isArray(res)){ if (!Array.isArray(res)) {
return return;
} }
if (res.every((item) => item.TYPE === 'S')) { if (res.every((item) => item.TYPE === "S")) {
this.goodsList = []; this.goodsList = [];
this.LGOBE = ''; this.LGOBE = "";
this.LGORT = ''; this.LGORT = "";
this.nlpla = ''; this.nlpla = "";
this.wxparams = ''; this.wxparams = "";
this.$u.toast('提交成功'); this.$u.toast("提交成功");
} }
const foundObject = res.find(item => item.TYPE === 'E'); const foundObject = res.find((item) => item.TYPE === "E");
if(foundObject && foundObject.MESSAGE){ if (foundObject && foundObject.MESSAGE) {
this.$u.toast(foundObject.MESSAGE); this.$u.toast(foundObject.MESSAGE);
} }
}); });
...@@ -189,23 +246,23 @@ export default { ...@@ -189,23 +246,23 @@ export default {
e && this.getPlnr(e); e && this.getPlnr(e);
}, },
handleInputNlpla(e) { handleInputNlpla(e) {
console.log(`output->e`,e) console.log(`output->e`, e);
this.nlplaDisabled = !!e this.nlplaDisabled = !!e;
}, },
reset(){ reset() {
setTimeout(() => { setTimeout(() => {
this.wxparams = ''; this.wxparams = "";
this.isFocus = true; this.isFocus = true;
this.isDisabled = false; this.isDisabled = false;
}, 1000); }, 1000);
}, },
getPlnr(qrcode) { getPlnr(qrcode) {
this.isDisabled = true; this.isDisabled = true;
this.isFocus = false this.isFocus = false;
if(!this.nlpla && this.vuex_user_factory !== '1010'){ if (!this.nlpla && this.vuex_user_factory !== "1010") {
this.$u.toast('请先扫描仓位'); this.$u.toast("请先扫描仓位");
this.reset() this.reset();
return return;
} }
// if(!this.nlpla){ // if(!this.nlpla){
// this.$u.toast('请先扫描仓位'); // this.$u.toast('请先扫描仓位');
...@@ -214,7 +271,7 @@ export default { ...@@ -214,7 +271,7 @@ export default {
// } // }
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) {
...@@ -224,29 +281,29 @@ export default { ...@@ -224,29 +281,29 @@ export default {
// 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) => {
this.nlpla && (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);
const result = res.data.filter((item, index, self) => { const result = res.data.filter((item, index, self) => {
return self.findIndex(t => t.qrcode === item.qrcode) === index; return self.findIndex((t) => t.qrcode === item.qrcode) === index;
}); });
this.goodsList = this.goodsList.concat(result) this.goodsList = this.goodsList.concat(result);
console.log(this.goodsList, '-goodsList') console.log(this.goodsList, "-goodsList");
this.reset() this.reset();
} else { } else {
this.reset() this.reset();
this.$u.toast(res.msg); this.$u.toast(res.msg);
} }
this.loading = false; this.loading = false;
}); });
} },
} },
}; };
</script> </script>
......
...@@ -116,21 +116,16 @@ export default { ...@@ -116,21 +116,16 @@ export default {
return this.vuex_sales_outbound[this.vbeln] || null; return this.vuex_sales_outbound[this.vbeln] || null;
}, },
plslen() { plslen() {
return this.goodsList.reduce((acc, cur) => { const codes = [];
return ( this.goodsList.forEach((cur) => {
acc + cur?.ZPLDT?.forEach((c) => {
(cur?.ZPLDT?.reduce((a, c) => { const code = c.ZCODE || c.PLNR;
if (c.ZCODE == "" && c.PLNR) { if (!codes.includes(code)) {
a.push(c.PLNR); codes.push(code);
} else if (c.PLNR && c.ZCODE) {
if (!a.includes(c.ZCODE)) {
a.push(c.ZCODE);
}
} }
return a; });
}, []).length || 0) });
); return codes.length;
}, 0);
}, },
saleInfo() { saleInfo() {
return this.goodsList[0] || {}; return this.goodsList[0] || {};
...@@ -305,7 +300,7 @@ export default { ...@@ -305,7 +300,7 @@ export default {
} }
}); });
} else { } else {
item.ZPLDT.splice(idx, 1) item.ZPLDT.splice(idx, 1);
} }
}, },
// 加载更多 // 加载更多
......
...@@ -282,7 +282,6 @@ page { ...@@ -282,7 +282,6 @@ page {
margin: 20rpx; margin: 20rpx;
} }
.cardbox { .cardbox {
max-height: calc(100vh - 105px - 60rpx - 140rpx);
padding: 0rpx 20rpx; padding: 0rpx 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }
......
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