Browse Source

库存转移

wms3.0_pda
lijuncheng 11 months ago
parent
commit
52be1a3298
  1. 71
      pages/inventoryMove/coms/comMove.vue
  2. 4
      pages/inventoryMove/coms/comMovebalance.vue

71
pages/inventoryMove/coms/comMove.vue

@ -17,15 +17,16 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="toLocationTypeArray"></requiredLocation>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="toLocationTypeArray"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view> </view>
</view> </view>
</view> </view>
@ -57,6 +58,9 @@
import { import {
getBusinessType, getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';
export default { export default {
@ -96,8 +100,7 @@
toLocationCode: "", toLocationCode: "",
toLocationInfo: {}, toLocationInfo: {},
toLocationTypeArray: [], toLocationTypeArray: [],
fromInventoryStatus: [], toInventoryStatus: "",
toInventoryStatus: [],
businessType: {}, // businessType: {}, //
detailSource: [], // detailSource: [], //
} }
@ -128,14 +131,19 @@
name = "库存转移记录"; name = "库存转移记录";
}else if(this.businessTypeCode=="HoldToOkRecord"){ }else if(this.businessTypeCode=="HoldToOkRecord"){
name = "隔离转合格记录"; name = "隔离转合格记录";
this.toInventoryStatus = "OK"
}else if(this.businessTypeCode=="HoldToScrapRecord"){ }else if(this.businessTypeCode=="HoldToScrapRecord"){
name = "隔离转报废记录"; name = "隔离转报废记录";
this.toInventoryStatus = "SCRAP"
}else if(this.businessTypeCode=="OkToHoldRecord"){ }else if(this.businessTypeCode=="OkToHoldRecord"){
name = "合格转隔离记录"; name = "合格转隔离记录";
this.toInventoryStatus ="HOLD"
}else if(this.businessTypeCode=="OktoScrapRecord"){ }else if(this.businessTypeCode=="OktoScrapRecord"){
name = "合格转报废记录"; name = "合格转报废记录";
this.toInventoryStatus ="SCRAP"
}else if(this.businessTypeCode=="ScrapToHoldRecord"){ }else if(this.businessTypeCode=="ScrapToHoldRecord"){
name = "报废转隔离记录"; name = "报废转隔离记录";
this.toInventoryStatus ="HOLD"
} }
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: name title: name
@ -163,14 +171,6 @@
this.openScanPopup(); this.openScanPopup();
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.toLocationCodeInfo = location;
this.toLocationCode = code; this.toLocationCode = code;
}, },
getScanResult(result) { getScanResult(result) {
@ -186,8 +186,8 @@
} }
}) })
if (item == undefined) { if (item == undefined) {
var itemp = this.createItemInfo(balance,pack); var itemp = createItemInfo(balance,pack);
let newDetail = this.createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
@ -202,13 +202,13 @@
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = this.createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
this.showErrorMessage(balance.packingNumber + "已经在列表中") this.showErrorMessage(balance.packingNumber + "已经在列表中")
} }
} }
this.calcHandleQty(); calcHandleQty(this.detailSource);
}, },
@ -256,7 +256,13 @@
}); });
}, },
updateData() { updateData() {
this.calcHandleQty(); calcHandleQty(this.detailSource);
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
}, },
removePack() { removePack() {
@ -276,7 +282,36 @@
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
} }
} }
},
commit() {
uni.showLoading({
title: "提交中....",
mask: true
});
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
console.log("提交参数", JSON.stringify(params));
//
//退
var params = this.setRecordParams(true)
console.log("提交参数", JSON.stringify(params));
purchaseReturnRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购退货记录" + res.data)
} else {
this.showErrorMessage("提交失败" + res.msg)
} }
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
this.showErrorMessage("没有要提交的数据")
}
},
} }
} }
</script> </script>

4
pages/inventoryMove/coms/comMovebalance.vue

@ -29,8 +29,8 @@
</view> </view>
</view> </view>
<u-line></u-line> <!-- <u-line></u-line> -->
<purchase-info :dataContent="dataContent.package"></purchase-info> <!-- <purchase-info :dataContent="dataContent.package"></purchase-info> -->
</view> </view>
</view> </view>
</template> </template>

Loading…
Cancel
Save