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

优化及bug修改

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