Commit d65625eb authored by xiangzj's avatar xiangzj

生产发料

parent 572b25a1
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
<view class="contentBox"> <view class="contentBox">
<slot></slot> <slot></slot>
<u-loadmore class="bottomArea" :status="status" v-if="loadmore" /> <u-loadmore class="bottomArea" :status="status" v-if="loadmore" />
<view class="noList" v-if="list.length === 0">
暂无数据
</view>
</view> </view>
</template> </template>
...@@ -17,6 +20,12 @@ export default { ...@@ -17,6 +20,12 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
list: {
type: Array,
default: function () {
return [];
}
}
}, },
methods: { methods: {
// // 加载更多 // // 加载更多
...@@ -34,4 +43,9 @@ export default { ...@@ -34,4 +43,9 @@ export default {
.contentBox{ .contentBox{
padding-bottom: 160rpx !important; padding-bottom: 160rpx !important;
} }
.noList{
text-align: center;
margin-top: 100rpx;
font-size: 14px;
}
</style> </style>
\ No newline at end of file
...@@ -35,11 +35,11 @@ ...@@ -35,11 +35,11 @@
</view> </view>
</view> </view>
</StickyNavBar> </StickyNavBar>
<view class="cardbox"> <ContentLoadingMore class="cardbox" :list='goodsList'>
<view class="cardContent" v-for="(item, index) in goodsList" :key="item.workorderCode"> <view class="cardContent" v-for="(item, index) in goodsList" :key="item.workorderCode">
<scanningList :item='item' :list='list'/> <scanningList :item='item' :list='list'/>
</view> </view>
</view> </ContentLoadingMore>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
</view> </view>
</template> </template>
...@@ -89,17 +89,17 @@ export default { ...@@ -89,17 +89,17 @@ export default {
computed:{ computed:{
totalNum(){ totalNum(){
let num = 0 let num = 0
// let i=null,j=null let i=null,j=null
// for(i = 0; i < this.goodsList.length; i++){ const data = JSON.parse(JSON.stringify(this.list))
// for(j = 0; j < this.list.length; j++){ const result = data.filter((item, index, self) => {
// if(this.goodsList[i].itemCode === this.list[j].itemCode){ return self.findIndex(t => t.itemCode === item.itemCode) === index;
// console.log(`output->`,this.list[j].vista) });
// num = (num - 0) + (this.list[j].vista - 0) for(i = 0; i < this.goodsList.length; i++){
// } if(this.goodsList[i].itemCode === result[i].itemCode && result[i].vista){
// } num++
// } }
// console.log(`output->num`,num) }
return num || '' return num || 0
}, },
}, },
onLoad(option) { onLoad(option) {
...@@ -107,6 +107,9 @@ export default { ...@@ -107,6 +107,9 @@ export default {
this.OrderNum = option.order this.OrderNum = option.order
this.getOrder(option.order) this.getOrder(option.order)
} }
},
watch: {
}, },
created() { created() {
// this.handleInputNlpla() // this.handleInputNlpla()
...@@ -269,9 +272,9 @@ export default { ...@@ -269,9 +272,9 @@ export default {
} }
return return
} }
if(this.list[m].grantNum){ // if(this.list[m].grantNum){
// 发过多少货
}else{ // }else{
if(!this.list[m].vista){ if(!this.list[m].vista){
if(this.list[m-1] && this.list[m-1].vista < this.list[m-1].applyNum){ if(this.list[m-1] && this.list[m-1].vista < this.list[m-1].applyNum){
const newCard = { const newCard = {
...@@ -281,24 +284,25 @@ export default { ...@@ -281,24 +284,25 @@ export default {
charg: res.BLPL[0].CHARG charg: res.BLPL[0].CHARG
} }
this.list.splice(m, 0, newCard); this.list.splice(m, 0, newCard);
console.log(`output->Math.f`,Math.floor(plnr.slice(29, 40)) , this.list[m-1].applyNum , this.list[m-1].vista)
if( Math.floor(plnr.slice(29, 40)) > (this.list[m-1].applyNum - this.list[m-1].vista)){ if( Math.floor(plnr.slice(29, 40)) > (this.list[m-1].applyNum - this.list[m-1].vista)){
this.factorial(res,plnr, m+1, Math.floor(plnr.slice(29, 40)) - (this.list[m-1].applyNum - this.list[m-1].vista)) this.factorial(res,plnr, m+1, Math.floor(plnr.slice(29, 40)) - (this.list[m-1].applyNum - this.list[m-1].vista))
} }
return return
} }
if(count - 1 === m){ if(count === 1){
this.list[m].charg = res.BLPL[0].CHARG this.$set(this.list,m,{...this.list[m],vista : Math.floor(plnr.slice(29, 40)),charg: res.BLPL[0].CHARG})
this.list[m].vista = Math.floor(plnr.slice(29, 40))
}else{ }else{
if( Math.floor(plnr.slice(29, 40)) > this.list[m].applyNum){ if( Math.floor(plnr.slice(29, 40)) > this.list[m].applyNum){
if(count === m){
this.$set(this.list,m,{...this.list[m],vista : Math.floor(plnr.slice(29, 40)),charg: res.BLPL[0].CHARG})
return
}
this.list[m].vista = this.list[m].applyNum this.list[m].vista = this.list[m].applyNum
this.$set(this.list,m,{...this.list[m],vista : this.list[m].applyNum,charg: res.BLPL[0].CHARG}) this.$set(this.list,m,{...this.list[m],vista : this.list[m].applyNum,charg: res.BLPL[0].CHARG})
this.factorial(res,plnr,m+1,Math.floor(plnr.slice(29, 40))-this.list[m].applyNum) this.factorial(res,plnr,m+1,Math.floor(plnr.slice(29, 40))-this.list[m].applyNum)
return; return;
}else{ }else{
this.list[m].charg = res.BLPL[0].CHARG this.$set(this.list,m,{...this.list[m],vista : Math.floor(plnr.slice(29, 40)),charg: res.BLPL[0].CHARG})
this.list[m].vista = Math.floor(plnr.slice(29, 40))
} }
} }
}else{ }else{
...@@ -314,10 +318,11 @@ export default { ...@@ -314,10 +318,11 @@ export default {
this.list.splice(m+1, 0, newCard); this.list.splice(m+1, 0, newCard);
return return
} }
}else{
this.$u.toast('暂无剩余工单');
} }
} }
} // }
} }
} }
// if(idx){ // if(idx){
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</view> </view>
</view> </view>
</StickyNavBar> </StickyNavBar>
<ContentLoadingMore class="cardbox"> <ContentLoadingMore class="cardbox" :list='goodsList'>
<view class="cardContent" v-for="(item, index) in goodsList"> <view class="cardContent" v-for="(item, index) in goodsList">
<view class="listItemTitle"> <view class="listItemTitle">
<view> <view>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</view> </view>
</view> </view>
</StickyNavBar> </StickyNavBar>
<ContentLoadingMore class="contentMore"> <ContentLoadingMore class="contentMore" :list='goodsList'>
<view class="cardbox"> <view class="cardbox">
<view class="cardContent" v-for="(item, index) in goodsList" :key="item.MATNR"> <view class="cardContent" v-for="(item, index) in goodsList" :key="item.MATNR">
<scanningList :item='item'/> <scanningList :item='item'/>
...@@ -55,6 +55,7 @@ import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue'; ...@@ -55,6 +55,7 @@ import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue';
import BottomBtn from '@/components/BottomBtn/index.vue'; import BottomBtn from '@/components/BottomBtn/index.vue';
import scanningList from "./scanningList.vue" import scanningList from "./scanningList.vue"
import stockList from "./stockList.vue" import stockList from "./stockList.vue"
import { parseTime} from "@/utils/ruoyi";
export default { export default {
components: { components: {
StickyNavBar, StickyNavBar,
...@@ -135,6 +136,27 @@ export default { ...@@ -135,6 +136,27 @@ export default {
}); });
}); });
}, },
goCarry(){
const params = {
"VBELN": this.goodsList[0].VBELN,
"WADAT": parseTime(new Date())
}
this.$u.api.sapApi
.sapDelv(params)
.then((res) => {
this.loading = false;
console.log(res);
if (res.every((item) => item.TYPE === 'S')) {
this.$u.toast('提交成功');
}
res.forEach((ele) => {
if (ele.TYPE === 'E') {
this.$u.toast(ele.MESSAGE);
}
});
});
},
getPlnr(plnr) { getPlnr(plnr) {
this.totalNum = 0; this.totalNum = 0;
this.$u.api.sapApi this.$u.api.sapApi
......
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