Commit 2d8cf19a by Jaxon

Merge branch 'feature/d-plus-list-product' into 'SAAS+V5.7.1'

fix(商品上架): 修正商品选择禁用逻辑和表单数据同步

See merge request !591
2 parents 6f5eda3c 31a49fba
......@@ -77,7 +77,7 @@
@setTableFinishFun="setTableFinishFun">
<template #select_btn="scope">
<el-radio v-model="selectedRowId"
:disabled="packageSelectIds && packageSelectIds.includes(scope.scope.commodityCode)"
:disabled="packageSelectIds && packageSelectIds.includes(scope.scope.id)"
:label="scope.scope.id">
{{ '' }}
</el-radio>
......
......@@ -172,7 +172,7 @@
<Product :ref="`productForm${goodsForm.id}`"
:product="goodsForm"
:mode="VIEW_MODE.EDIT"
:disabled-ids="packageSelectedGoodsCommodityCode"
:disabled-ids="packageSelectedGoodsIds"
:scene-type="packageForm.sceneType"
:show-gift-cost="false"
:show-business-line="false"
......@@ -180,6 +180,7 @@
:show-settlement-type="false"
:show-penetration-rate="false"
use-remove-btn
@update:product="handleUpdateProduct($event, index)"
@remove="handleRemoveProduct(goodsForm.id, index)" />
<el-divider v-if="index !== (goodsList.length - 1)" class="divider-product" />
</div>
......@@ -246,8 +247,8 @@ export default {
},
computed: {
// 返回已选的商品id
packageSelectedGoodsCommodityCode() {
return this.goodsList?.map(item => item.upgradeCommodityCode) || [];
packageSelectedGoodsIds() {
return this.goodsList?.map(item => item.upgradeGoods?.id) || [];
},
},
watch: {
......@@ -281,6 +282,9 @@ export default {
isMemberRightsUpgrade,
isQualityUpgrade,
isSolarFilm,
handleUpdateProduct(product, goodsListIndex) {
this.$set(this.goodsList, goodsListIndex, product);
},
async handleRemoveProduct(_id, index) {
await this.$confirm("是否确认删除该商品?", "删除商品", {
confirmButtonText: "是",
......
......@@ -363,6 +363,7 @@ export default {
this.dialog.selectGoods.show = true;
},
handleSelectGoodsClose() {
this.$emit("update:product", this.formDetail);
this.$refs.formRef.validateField("upgradeGoodsId");
this.dialog.selectGoods.show = false;
},
......@@ -384,6 +385,8 @@ export default {
this.$set(this.formData, "upgradeGoods", selectedForm);
this.formData.upgradeGoodsId = selectedData.id;
this.formData.goodsType = selectedData?.goodsInfo?.goodsType;
this.formDetail.upgradeGoodsId = selectedData.id;
this.formDetail.goodsType = selectedData?.goodsInfo?.goodsType;
this.formData.position = undefined;
// 太阳膜
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!