fix: 修复新增首个规格项的规格值时。规格列表显示错乱问题

master
paulGao 2022-10-14 15:43:39 +08:00
parent eb9c999a16
commit 17a4131bf1
2 changed files with 29 additions and 12 deletions

View File

@ -5,7 +5,7 @@
<Card class="mb_10" v-if="(afterSale.serviceStatus == 'PASS' &&
afterSale.serviceType != 'RETURN_MONEY') || (afterSale.afterSaleAllowOperationVO && afterSale.afterSaleAllowOperationVO.cancel)">
<Button type="success" @click="openModal" v-if="afterSale.serviceStatus == 'PASS' &&
afterSale.serviceType != 'RETURN_MONEY'" size="small">提交物流</Button>
afterSale.serviceType != 'RETURN_MONEY'" size="small">提交物流</Button>&nbsp;
<Button type="error" @click="cancel(afterSale.sn)" v-if="afterSale.afterSaleAllowOperationVO && afterSale.afterSaleAllowOperationVO.cancel" size="small"></Button>
</Card>
<div class="order-card">

View File

@ -1473,18 +1473,35 @@ export default {
filterSkuInfo.forEach((skuInfo) => {
totalLength *= skuInfo.spec_values.length;
});
for (let i = 0; i < totalLength; i++) {
let find = cloneObj(this.skuTableData[index - 1]);
find[item.name] = "";
find.id = "";
find.price && (find.price = "");
find.sn && (find.sn = "");
find.cost && (find.cost = "");
find.quantity && (find.quantity = "");
find.weight && (find.weight = "");
if ($index === 0) {
index = 1;
for (let i = 0; i < totalLength; i++) {
let find = cloneObj(this.skuTableData[index - 1]);
find[item.name] = "";
find.id = "";
find.price && (find.price = "");
find.sn && (find.sn = "");
find.cost && (find.cost = "");
find.quantity && (find.quantity = "");
find.weight && (find.weight = "");
this.skuTableData.splice(index, 0, find);
index += beforeLength + 1;
this.skuTableData.splice(this.skuTableData.length, 0, find);
index ++;
}
} else {
for (let i = 0; i < totalLength; i++) {
let find = cloneObj(this.skuTableData[index - 1]);
find[item.name] = "";
find.id = "";
find.price && (find.price = "");
find.sn && (find.sn = "");
find.cost && (find.cost = "");
find.quantity && (find.quantity = "");
find.weight && (find.weight = "");
this.skuTableData.splice(index, 0, find);
index += $index === 0 ? beforeLength : beforeLength + 1;
}
}
}
this.baseInfoForm.regeneratorSkuFlag = true;