Commit 89474e23 authored by dragondean@qq.com's avatar dragondean@qq.com

拆单

parent 775dfb55
......@@ -771,59 +771,6 @@ export default {
// 重置表单数据
this.shopForm = {specsRecordVOList:[]}
},
/*// 更改放入品名后触发,计算重量体积等默认值
onProdChange(){
// 根据键值(中文名或者英文名)来获取对应商品的信息,注:这里应该可以采用orderItemId来获取更优,而不是商品名称,同名可能导致异常
let orderItem = this.orderData.orderItemVOList.find(item => item.orderItemId == this.shopForm.orderItemId)
console.log({orderItem})
// 剩余可装箱数,订单入仓箱数 - 订单已装箱数 - 已拆箱数
let leftNum = Decimal(this.currRow.num).minus(this.currRow.installNum).minus(this.totalSplit('num'))
// 剩余箱数
this.$set(this.shopForm, 'leftNum', leftNum)
// 如果主单商品项的入仓箱数小于可装箱数,则取商品项数据
leftNum = Math.min(leftNum, this.mainOrderItem.num)
// 放入箱数
// this.$set(this.shopForm, 'num', leftNum)
// 默认给一个入仓记录
if(!this.shopForm.specsRecordVOList || !this.shopForm.specsRecordVOList.length){
this.addRow()
}
// this.calcAverg()
},*/
// 按比例计算体积重量的默认值
/*calcAverg(){
// 装箱比例
const rate = this.shopForm.num / this.mainOrderItem.num
// 放入个数,剩余个数是算不出来的,因为不知道已装数量,所以放入数量只能按照总数的比例计算
this.$set(this.shopForm, 'quantity', Math.ceil(this.mainOrderItem.quantity*rate|| 0 * rate))
// 数量,体积,重量等按照比例给默认值
this.$set(this.shopForm, 'volume', (this.mainOrderItem.volume * rate).toFixed(2))
this.$set(this.shopForm, 'chargeVolume', (this.mainOrderItem.chargeVolume * rate).toFixed(2))
this.$set(this.shopForm, 'weight', (this.mainOrderItem.weight * rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (this.mainOrderItem.chargeWeight * rate).toFixed(2))
this.$set(this.shopForm, 'worth', (this.mainOrderItem.worth * rate).toFixed(2))
},*/
/*async getSelectData(item) {
await quantityRequired(this.orderData.lineId).then((res) => {
if (res.data) {
this.isQuantity = true;
this.shopRules.putQuantity = [
{
required: true,
message: this.$t("请输入数量(个)"),
trigger: "change",
},
];
} else {
this.isQuantity = false;
delete this.shopRules.putQuantity;
}
});
},*/
shopAdd() {
this.$refs["shopForm"].validate((valid) => {
if (valid) {
......
This diff is collapsed.
This diff is collapsed.
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