Commit e9c717fe authored by huhaiqing's avatar huhaiqing

修改已放入的无法选择

parent b35eb5d9
......@@ -10,7 +10,7 @@
{{orderData.marks?orderData.marks:$t('')}}
</el-descriptions-item>
<el-descriptions-item :label="$t('已实装箱数/总箱数')">
<span>{{currRow.installNum||0}}/{{orderData.costVO?orderData.costVO.totalNum:0}}</span>
<span>{{currRow.installNum||0}}/{{currRow.num||0}}</span>
</el-descriptions-item>
<el-descriptions-item :label="$t('订单状态')">
{{orderData.status==99? $t('异常'):$t('正常')}}
......@@ -183,14 +183,14 @@
<el-row>
<el-form-item :label="$t('中文品名')+':'" prop="zhId">
<el-select v-model="shopForm.zhId" :placeholder="$t('请选择中文品名')" @change="changeProdTitleZh">
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.id" :key="item.id"></el-option>
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.id" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('英文品名')+':'" prop="enId">
<el-select v-model="shopForm.enId" :placeholder="$t('请选择英文品名')" @change="changeProdTitleEn">
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.id" :key="item.id"></el-option>
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.id" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select>
</el-form-item>
<el-row>
......@@ -339,6 +339,14 @@ export default {
});
return _total;
},
totalSplitQty() {
let _total = 0;
const { orderSplitItemBackVOList = [] } = this.splitData;
orderSplitItemBackVOList.forEach((v) => {
_total = Decimal.add(_total, Number(v.quantity)).toNumber();
});
return _total;
},
/* 打开拆单 */
getSplit() {
this.orderItems = this.currRow.goodsList ?? [];
......@@ -352,6 +360,13 @@ export default {
this.splitData = data.filter((item) => !item.isMaster)?.[0] ?? {};
});
},
itemDisabled(data) {
const { orderSplitItemBackVOList = [] } = this.splitData;
const isExist = orderSplitItemBackVOList.find(
(item) => item.orderItemId === data.orderItemId
);
return isExist ? true : false;
},
/* 查询拆单项 */
querySplitGoods() {
getSplitList({
......@@ -465,6 +480,7 @@ export default {
const data = list[0];
const itemNum = data.num ?? 0;
const itemQty = data.quantity ?? 0;
// 获取拆单项的总num
const total = this.totalSplitNum();
// 订单的剩余
......@@ -483,10 +499,19 @@ export default {
if (remainNum < itemNum) {
this.shopForm.num = this.shopForm.putNum = remainNum;
}
const totalQty = this.totalSplitQty();
this.shopForm.quantity = 0;
if (totalQty >= itemQty) {
this.shopForm.quantity = totalQty;
}
if (totalQty < itemQty) {
this.shopForm.quantity = itemQty;
}
this.shopForm.orderItemId = data.orderItemId;
this.shopForm.quantity = data.quantity ?? 0;
this.shopForm.putQuantity = Decimal.div(
data.quantity ?? 0,
this.shopForm.quantity,
this.shopForm.num
).toFixed(0);
return data;
......
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