|
|
|
|
@ -16,7 +16,9 @@ |
|
|
|
|
@confirm="handleBoxConfirm" |
|
|
|
|
placeholder="物料箱条码" |
|
|
|
|
class="uni-input-border" |
|
|
|
|
confirm-type="done" |
|
|
|
|
:focus="boxInputFocus" |
|
|
|
|
:key="'box-' + boxInputFocus" |
|
|
|
|
/> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -50,7 +52,9 @@ |
|
|
|
|
placeholder="流程卡号" |
|
|
|
|
class="uni-input-border" |
|
|
|
|
:class="{ 'input-disabled': !activeBox }" |
|
|
|
|
confirm-type="done" |
|
|
|
|
:focus="cardInputFocus" |
|
|
|
|
:key="'card-' + cardInputFocus" |
|
|
|
|
/> |
|
|
|
|
</uni-forms-item> |
|
|
|
|
</uni-forms> |
|
|
|
|
@ -134,7 +138,6 @@ export default { |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 删除订单 |
|
|
|
|
handleDeleteOrder(order, index) { |
|
|
|
|
uni.showModal({ |
|
|
|
|
title: "确认删除", |
|
|
|
|
@ -154,37 +157,27 @@ export default { |
|
|
|
|
handleBoxConfirm() { |
|
|
|
|
const code = this.boxCode.trim(); |
|
|
|
|
if (!code) return; |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: "查询中...", |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.boxInfo = { |
|
|
|
|
yieldOrderList: [], |
|
|
|
|
}; |
|
|
|
|
this.$u.api |
|
|
|
|
.boxbarcodeDetails({ boxBarcode: this.boxCode }) |
|
|
|
|
.then((res) => { |
|
|
|
|
this.boxInfo = res.data; |
|
|
|
|
if (res.data.yieldOrderList == null) { |
|
|
|
|
if (this.boxInfo.yieldOrderList == null) { |
|
|
|
|
this.boxInfo.yieldOrderList = []; |
|
|
|
|
} |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
this.activeBox = code; |
|
|
|
|
// 加载已有数据,如果没有则为空箱 |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: `物料箱 ${code} 已就绪`, |
|
|
|
|
icon: "success", |
|
|
|
|
}); |
|
|
|
|
this.boxCode = ""; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.boxInputFocus = false; |
|
|
|
|
this.cardInputFocus = true; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
this.activeBox = code; |
|
|
|
|
// 加载已有数据,如果没有则为空箱 |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: `物料箱 ${code} 已就绪`, |
|
|
|
|
icon: "success", |
|
|
|
|
}); |
|
|
|
|
this.boxCode = ""; |
|
|
|
|
this.boxInputFocus = false; |
|
|
|
|
this.cardInputFocus = true; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
handleCardConfirm() { |
|
|
|
|
// const code = this.cardCode.trim(); |
|
|
|
|
const code = this.cardCode; |
|
|
|
|
// if (!code) return; |
|
|
|
|
if (this.cardCode) { |
|
|
|
|
if (!this.activeBox) { |
|
|
|
|
@ -192,10 +185,10 @@ export default { |
|
|
|
|
title: "请先扫描物料箱条码", |
|
|
|
|
icon: "none", |
|
|
|
|
}); |
|
|
|
|
this.boxInputFocus = false; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.boxInputFocus = true; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if ( |
|
|
|
|
@ -214,16 +207,32 @@ export default { |
|
|
|
|
} |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: "查询中...", |
|
|
|
|
mask: true, |
|
|
|
|
}); |
|
|
|
|
this.$u.api |
|
|
|
|
.queryCardNo({ cardNo: this.cardCode }) |
|
|
|
|
.then((res) => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
this.boxInfo.yieldOrderList.push(res.data); |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: `流程卡 ${code} 装箱成功`, |
|
|
|
|
icon: "success", |
|
|
|
|
}); |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
// 计算当前总重量 |
|
|
|
|
const currentWeight = this.boxInfo.yieldOrderList.reduce( |
|
|
|
|
(sum, o) => { |
|
|
|
|
return sum + (Number(o.actualWeighing) || 0); |
|
|
|
|
}, |
|
|
|
|
0 |
|
|
|
|
); |
|
|
|
|
if (currentWeight > 50000) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: `请注意箱子已超重!!!!!`, |
|
|
|
|
icon: "warring", |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: `流程卡 ${code} 装箱成功`, |
|
|
|
|
icon: "success", |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.cardCode = ""; |
|
|
|
|
this.cardInputFocus = false; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
@ -231,7 +240,10 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
.catch((err) => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: err, |
|
|
|
|
icon: "error", |
|
|
|
|
}); |
|
|
|
|
this.cardCode = ""; |
|
|
|
|
this.cardInputFocus = false; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
@ -247,30 +259,21 @@ export default { |
|
|
|
|
this.orders = []; |
|
|
|
|
this.boxInputFocus = true; |
|
|
|
|
this.cardInputFocus = false; |
|
|
|
|
this.boxInfo.yieldOrderList = []; |
|
|
|
|
}, |
|
|
|
|
// 装箱确认 |
|
|
|
|
handleSubmit() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: "提交中...", |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.$u.api |
|
|
|
|
.boxBinding({ |
|
|
|
|
boxBarcode: this.activeBox, //箱条码 |
|
|
|
|
orderIdList: this.boxInfo.yieldOrderList.map((o) => o.cardNo), |
|
|
|
|
}) |
|
|
|
|
.then((res) => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: `装箱成功`, |
|
|
|
|
icon: "success", |
|
|
|
|
}); |
|
|
|
|
this.cardCode = ""; |
|
|
|
|
this.boxInfo.yieldOrderList = []; |
|
|
|
|
}) |
|
|
|
|
.catch((err) => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
|