Commit 6e13fa74 by liangjianmin

refactor(arrivalRegister): 优化净重和毛重尺寸单位逻辑,提升用户体验

- 根据当前净重和毛重类型动态设置对应的尺寸单位,增强了逻辑的清晰性
- 统一了标准和单位净重、毛重的处理方式,确保代码一致性
- 改进了用户交互体验,确保用户选择时的反馈更加直观
parent 38486012
Showing with 30 additions and 8 deletions
......@@ -662,13 +662,24 @@
}
break;
//选择标标准包净重-单位
//选择净重尺寸单位 - 根据当前净重类型设置对应字段
case 6:
this.netWeightSizeIndex = e.detail.value;
if (this.netWeightSizeIndex == 1) {
this.saveZyGoodsParams[index].net_weight_size = 2;
// 根据当前选择的净重类型(标准/单位)设置对应的尺寸字段
if (this.netWeightIndex == 0) {
// 当前是标准包装净重,设置标准净重尺寸
if (this.netWeightSizeIndex == 1) {
this.saveZyGoodsParams[index].net_weight_size = 2; // g
} else {
this.saveZyGoodsParams[index].net_weight_size = 1; // kg
}
} else {
this.saveZyGoodsParams[index].net_weight_size = 1;
// 当前是单位净重,设置单位净重尺寸
if (this.netWeightSizeIndex == 1) {
this.saveZyGoodsParams[index].unit_net_weight_size = 2; // g
} else {
this.saveZyGoodsParams[index].unit_net_weight_size = 1; // kg
}
}
this.$forceUpdate();
break;
......@@ -683,13 +694,24 @@
this.saveZyGoodsParams[index].unit_gross_weight = '';
}
break;
//选择标准包毛重-单位
//选择毛重尺寸单位 - 根据当前毛重类型设置对应字段
case 8:
this.grossWeightSizeIndex = e.detail.value;
if (this.grossWeightSizeIndex == 1) {
this.saveZyGoodsParams[index].gross_weight_size = 2;
// 根据当前选择的毛重类型(标准/单位)设置对应的尺寸字段
if (this.grossWeightIndex == 0) {
// 当前是标准包装毛重,设置标准毛重尺寸
if (this.grossWeightSizeIndex == 1) {
this.saveZyGoodsParams[index].gross_weight_size = 2; // g
} else {
this.saveZyGoodsParams[index].gross_weight_size = 1; // kg
}
} else {
this.saveZyGoodsParams[index].gross_weight_size = 1;
// 当前是单位毛重,设置单位毛重尺寸
if (this.grossWeightSizeIndex == 1) {
this.saveZyGoodsParams[index].unit_gross_weight_size = 2; // g
} else {
this.saveZyGoodsParams[index].unit_gross_weight_size = 1; // kg
}
}
break;
//其他属性
......
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 sign in to comment