Commit 3f492ed2 authored by 何远江's avatar 何远江

优化及bug修改

parent 5bfce159
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
<view class="headerTitle"> <view class="headerTitle">
<view class=""> <view class="">
<view class="items" <view class="items"
>领料申请:{{ goodsList[0] && goodsList[0].applyNo }}</view >领料申请:{{ goodsInfo.applyNo }}</view
> >
<view class="items" <view class="items"
>{{ goodsList[0] && goodsList[0].workstationCode }}/{{ >{{ goodsInfo.workstationCode }}/{{
goodsList[0] && goodsList[0].workstationName goodsInfo.workstationName
}}</view }}</view
> >
<view class="items" <view class="items"
>计划日期:{{ goodsList[0] && goodsList[0].startTime }}</view >计划日期:{{ goodsInfo.startTime }}</view
> >
</view> </view>
<view class="checkedCase"> <view class="checkedCase">
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
<view class="left">物料明细</view> <view class="left">物料明细</view>
<view class="right"> <view class="right">
物料数量: 物料数量:
<!-- <text class="blue">{{ totalNum }}</text>
<text class="line">/</text> -->
<text class="">{{ goodsList.length }}</text> <text class="">{{ goodsList.length }}</text>
</view> </view>
</view> </view>
...@@ -94,6 +92,9 @@ export default { ...@@ -94,6 +92,9 @@ export default {
}; };
}, },
computed: { computed: {
goodsInfo() {
return this.goodsList[0] || {}
},
totalNum() { totalNum() {
let num = 0; let num = 0;
let i = null, let i = null,
...@@ -138,25 +139,27 @@ export default { ...@@ -138,25 +139,27 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res && res.code - 200 === 0) { if (res && res.code - 200 === 0) {
this.goodsList = res.rows.reduce((pre, cur) => { this.goodsList = res.rows.reduce((acc, cur) => {
if (pre.length === 0) { if (acc.length === 0) {
pre.push({ acc.push({
...cur, ...cur,
details: [{ ...cur, vista: 0 }], details: [{ ...cur, vista: 0 }],
}); });
} else { } else {
const item = pre.find((v) => v.sapItemCode == cur.sapItemCode); const item = acc.find((v) => v.sapItemCode == cur.sapItemCode);
if (item) { if (item) {
item.details.push({ ...cur, vista: 0 }); item.details.push({ ...cur, vista: 0 });
} else { } else {
pre.push({ acc.push({
...cur, ...cur,
details: [{ ...cur, vista: 0 }], details: [{ ...cur, vista: 0 }],
}); });
} }
} }
return pre; return acc;
}, []); }, []);
console.log(this.goodsList, "----")
} else { } else {
this.$u.toast(res.msg); this.$u.toast(res.msg);
} }
...@@ -282,6 +285,8 @@ export default { ...@@ -282,6 +285,8 @@ export default {
if (item) { if (item) {
// 用于缓存新添加的 details // 用于缓存新添加的 details
const map = new Map(); const map = new Map();
console.log(item, '-----')
item.details.some((v, i) => { item.details.some((v, i) => {
// 如果没有数量了,终止分配 // 如果没有数量了,终止分配
......
...@@ -35,12 +35,10 @@ ...@@ -35,12 +35,10 @@
<view class="items">生产单号:{{ ele.workorderCode }}</view> <view class="items">生产单号:{{ ele.workorderCode }}</view>
<view class="progress"> <view class="progress">
<progress :percent="handleVista(ele)" show-info /> <progress :percent="handleVista(ele)" show-info />
<!-- <u-line-progress active-color="#2979ff" :percent="handleVista(ele)"></u-line-progress> -->
</view> </view>
</view> </view>
<view class="items inputItem"> <view class="items inputItem">
数量: 数量:
<!-- <uni-easyinput v-model="item.vista"></uni-easyinput> -->
{{ handleUseVista(ele) }} {{ handleUseVista(ele) }}
/ /
{{ ele.applyNum }} {{ ele.applyNum }}
...@@ -49,12 +47,10 @@ ...@@ -49,12 +47,10 @@
<view class="items">PL:{{ item.PLNR }}</view> <view class="items">PL:{{ item.PLNR }}</view>
<view class="items">库位:{{ item.LGORT }} - {{ item.LGOBE }}</view> <view class="items">库位:{{ item.LGORT }} - {{ item.LGOBE }}</view>
<view class="items">仓位:{{ item.NLPLA }}</view> <view class="items">仓位:{{ item.NLPLA }}</view>
<!-- <view class="items">{{ item.MATNR }}</view> -->
</template> </template>
</view> </view>
</view> </view>
</view> </view>
<!-- <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> -->
</view> </view>
</template> </template>
...@@ -89,7 +85,7 @@ export default { ...@@ -89,7 +85,7 @@ export default {
if (item) { if (item) {
item.details.push({ ...cur }); item.details.push({ ...cur });
} else { } else {
acc.push({ ...cur, details: [{ ...cur }] }); acc.push({ ...cur, details: [{...cur}] });
} }
return acc; return acc;
}, []); }, []);
...@@ -103,25 +99,18 @@ export default { ...@@ -103,25 +99,18 @@ export default {
workCodes.push(cur.workorderCode); workCodes.push(cur.workorderCode);
return acc + cur.applyNum; return acc + cur.applyNum;
} }
}, 0); }, 0).toFixed(3);
}, },
totalVistaNum() { totalVistaNum() {
// let num = 0
// this.list.forEach(ele => {
// if(ele.itemCode === this.item.itemCode){
// num += (ele.vista-0)
// }
// });
// return num || ''
return this.list.reduce((acc, cur) => { return this.list.reduce((acc, cur) => {
return acc + cur.vista; return acc + cur.vista;
}, 0); }, 0).toFixed(3);
}, },
}, },
watch: { watch: {
details: { details: {
handler: function (val, oldVal) { handler: function (val, oldVal) {
console.log(val, "00-------"); console.log(val, "00-------", this.list);
}, },
immediate: true, immediate: true,
deep: true, deep: true,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<NavBar title="采购入库扫描"></NavBar> <NavBar title="采购入库扫描"></NavBar>
<FactorySelect v-model="warehouseCode" @change="warehouseChange" /> <FactorySelect v-model="warehouseCode" @change="warehouseChange" />
<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" v-model="nlpla" focus placeholder="请扫描库位" @change="handleInputNlpla"></uni-easyinput>
<uni-easyinput <uni-easyinput
prefixIcon="search" prefixIcon="search"
:disabled="isDisabled" :disabled="isDisabled"
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
}, },
getPlnr(plnr) { getPlnr(plnr) {
this.isDisabled = true; this.isDisabled = true;
if(!this.nlpla){ if(!this.nlpla && this.vuex_user_factory !== '1010'){
this.$u.toast('请先扫描仓位'); this.$u.toast('请先扫描仓位');
setTimeout(() => { setTimeout(() => {
this.wxparams = ''; this.wxparams = '';
......
...@@ -245,7 +245,8 @@ ...@@ -245,7 +245,8 @@
getPlnr(plnr) { getPlnr(plnr) {
let params = { let params = {
ZCODE: plnr.includes("BL") ? plnr : "", ZCODE: plnr.includes("BL") ? plnr : "",
plnr: plnr.includes("BL") ? "" : plnr, plnr: plnr.includes("BL") ? "" : plnr,
ztype: '005'
}; };
this.$u.api.sapApi.sapBlpl(params).then((res) => { this.$u.api.sapApi.sapBlpl(params).then((res) => {
if (res && res.MSG[0].TYPE === "S") { if (res && res.MSG[0].TYPE === "S") {
......
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