Commit b2cea61c authored by houjn@hikoon.cn's avatar houjn@hikoon.cn

Merge branch 'dev' of http://gitlab.jdshangmen.com/jiedao-app/jiedao-app-operator into dev1.6

 Conflicts:
	src/views/ecw/messageLeave/index.vue
parents adf8c792 b35eb5d9
...@@ -448,32 +448,53 @@ export default { ...@@ -448,32 +448,53 @@ export default {
this.isQuantity = false; this.isQuantity = false;
}, },
async changeProdTitleZh() { async changeProdTitleZh() {
const data = await this.getSelectData("zhId"); const item = this.setShopForm("zhId");
this.shopForm.enId = data.id; this.shopForm.enId = item.id;
this.shopForm = { ...this.shopForm }; this.shopForm = { ...this.shopForm };
await this.getSelectData(item);
}, },
async changeProdTitleEn() { async changeProdTitleEn() {
const data = await this.getSelectData("enId"); const item = this.setShopForm("enId");
this.shopForm.zhId = data.id; this.shopForm.zhId = item.id;
this.shopForm = { ...this.shopForm }; this.shopForm = { ...this.shopForm };
await this.getSelectData(item);
}, },
async getSelectData(key) { setShopForm(key) {
let list = []; let list = [];
list = this.orderItems.filter((item) => item.id == this.shopForm[key]); list = this.orderItems.filter((item) => item.id == this.shopForm[key]);
this.shopForm.num = this.currRow.num - this.currRow.installNum;
const data = list[0]; const data = list[0];
const itemNum = data.num ?? 0;
// 获取拆单项的总num
const total = this.totalSplitNum();
// 订单的剩余
const orderNum = this.currRow.num - this.currRow.installNum;
// 剩余可装
const remainNum = Decimal.sub(orderNum, total).toNumber();
this.shopForm.num = 0;
this.shopForm.putNum = 0;
// 剩余可装大于等于订单项剩余,显示订单剩余
if (remainNum >= itemNum) {
this.shopForm.num = remainNum;
this.shopForm.putNum = itemNum;
}
// 订单剩余小于订单项剩余,显示订单项剩余
if (remainNum < itemNum) {
this.shopForm.num = this.shopForm.putNum = remainNum;
}
this.shopForm.orderItemId = data.orderItemId; this.shopForm.orderItemId = data.orderItemId;
this.shopForm.putNum = data.num ?? 0;
this.shopForm.quantity = data.quantity ?? 0; this.shopForm.quantity = data.quantity ?? 0;
this.shopForm.putQuantity = Decimal.div( this.shopForm.putQuantity = Decimal.div(
data.quantity ?? 0, data.quantity ?? 0,
this.shopForm.num this.shopForm.num
).toFixed(0); ).toFixed(0);
return data;
},
async getSelectData(item) {
await quantitycheck({ await quantitycheck({
seaFreightVolume: data.seaFreightVolume, seaFreightVolume: item.seaFreightVolume,
clearanceFreightVolume: data.clearanceFreightVolume, clearanceFreightVolume: item.clearanceFreightVolume,
}).then((res) => { }).then((res) => {
if (res.data) { if (res.data) {
this.isQuantity = true; this.isQuantity = true;
...@@ -489,7 +510,6 @@ export default { ...@@ -489,7 +510,6 @@ export default {
delete this.shopRules.putQuantity; delete this.shopRules.putQuantity;
} }
}); });
return data;
}, },
shopAdd() { shopAdd() {
this.$refs["shopForm"].validate((valid) => { this.$refs["shopForm"].validate((valid) => {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建时间')"> <el-form-item :label="$t('创建时间')">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" label-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" /> type="datetimerange" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
......
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