Commit 6f5eda3c by Jaxon

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

fix(商品上架): 修复商品选择弹窗中禁用逻辑使用错误ID的问题

See merge request !590
2 parents dace67a5 07c40161
......@@ -77,7 +77,7 @@
@setTableFinishFun="setTableFinishFun">
<template #select_btn="scope">
<el-radio v-model="selectedRowId"
:disabled="packageSelectIds && packageSelectIds.includes(scope.scope.id)"
:disabled="packageSelectIds && packageSelectIds.includes(scope.scope.commodityCode)"
:label="scope.scope.id">
{{ '' }}
</el-radio>
......
......@@ -172,6 +172,7 @@
<Product :ref="`productForm${goodsForm.id}`"
:product="goodsForm"
:mode="VIEW_MODE.EDIT"
:disabled-ids="packageSelectedGoodsCommodityCode"
:scene-type="packageForm.sceneType"
:show-gift-cost="false"
:show-business-line="false"
......@@ -243,9 +244,12 @@ export default {
goodsList: [],
};
},
computed: {},
computed: {
// 返回已选的商品id
packageSelectedGoodsCommodityCode() {
return this.goodsList?.map(item => item.upgradeCommodityCode) || [];
},
},
watch: {
packages: {
handler(val) {
......
......@@ -23,7 +23,7 @@
</div>
<div v-if="formData.upgradeGoodsId" class="info-div">
<Descriptions class="sub-desc-wrapper"
:data="formData"
:data="formDetail"
:schema="productShelvingProductDetailSubFormItems" />
</div>
</el-form-item>
......@@ -207,6 +207,7 @@
<SelectGoodsDialog v-if="dialog.selectGoods.show"
append-to-body
:scene-type="sceneType"
:package-select-ids="disabledIds"
:filter-params="dialog.selectGoods.filterParams"
:select-goods-visible="dialog.selectGoods.show"
:upgrade-goods-id="formData.upgradeGoodsId"
......@@ -273,6 +274,11 @@ export default {
type: Boolean,
default: false,
},
// 在选择商品的弹窗里 禁用的id
disabledIds: {
type: Array,
default: () => [],
},
},
data() {
return {
......@@ -288,6 +294,7 @@ export default {
},
},
formRules: productFromRules,
formDetail: {},
formData: {
upgradeGoodsId: "",
goodsAlias: "",
......@@ -325,10 +332,12 @@ export default {
console.log("this.val", val);
if (!isEmpty(val)) {
this.$set(this, "formData", handleCoverProductForm(cloneDeep(val)));
this.$set(this, "formDetail", cloneDeep(val));
}
},
immediate: true,
},
},
async mounted() {
......@@ -361,8 +370,7 @@ export default {
handleSelectGoodsConfirm(selectedData) {
console.log("selectedData", selectedData);
console.log("selectedData.goodsInfo.goodsName", selectedData.goodsInfo.goodsName);
this.$set(this.formData, "upgradeGoods", {
const selectedForm = {
...selectedData,
goodsName: selectedData.goodsInfo.goodsName,
tempGoodsTypeName: getGoodsTypes(selectedData?.goodsInfo),
......@@ -371,9 +379,13 @@ export default {
djCost: selectedData?.djCost || 0,
carTypeConfigName: selectedData?.carTypeConfigList?.map(item => item.seriesName).join("/"),
commodityCode: selectedData?.commodityCode,
});
};
this.$set(this.formDetail, "upgradeGoods", cloneDeep(selectedData));
this.$set(this.formData, "upgradeGoods", selectedForm);
this.formData.upgradeGoodsId = selectedData.id;
this.formData.goodsType = selectedData?.goodsInfo?.goodsType;
this.formData.position = undefined;
// 太阳膜
if (selectedData?.goodsInfo?.goodsType === 1) {
this.$set(this.formData.upgradeGoods, "positionList", selectedData.position?.split(",")?.map(item => Number(item.trim())) || []);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!