Commit a9fd1790 by 张立顺

fix 联调bug修复

1 parent 17da5562
......@@ -713,6 +713,7 @@ export default {
},
data() {
return {
priceUnitTypeList,
equitySceneType: baseConfig.equitySceneType || [], // 权益类目
extendedPosiType: baseConfig.extendedPosiType || [], // 延保类
minPrice: 0,
......
......@@ -355,6 +355,7 @@
:label="item.label ? item.label + ':' : ''"
:id="item.name"
:label-width="item.label ? '120px' : '0px'"
:required="item.name === 'accessoryType'"
class="dis-in-block"
:style="{ 'margin-bottom': !item.type ? '0px' : '22px' }"
v-if="
......@@ -1257,7 +1258,12 @@ export default {
if (valid) {
// 会员权益 类目
// if (this.equitySceneType.includes(this.formData.goodsType)) this.formData.productServiceItemList = this.productServiceItemList
this.formData.goodsPositionList = this.filterPosiotion()
const goodsPositionList = this.filterPosiotion()
if (goodsPositionList === true) {
this.$message.warning("请填写扣减标准")
return
}
this.formData.goodsPositionList = goodsPositionList
const brandOptionList =
this.formList[0].formBlock[
this.formList[0].formBlock.findIndex(
......@@ -1280,7 +1286,7 @@ export default {
)?.relatedPartyName)
this.$emit("handleAddConfirm", this.formData)
} else {
var needRuleList = Object.keys(options)
const needRuleList = options ? Object.keys(options) : []
if (
this.formData?.goodsName &&
!this.formData?.goodsName?.includes("太阳膜") &&
......@@ -1291,8 +1297,8 @@ export default {
"产品名称必须包含“太阳膜”字样才可将产品挂在太阳膜类目下"
)
}
this.jumpScroll(needRuleList[0])
return true
if (needRuleList?.length) this.jumpScroll(needRuleList[0])
return
}
if (callback) callback(this.formData)
})
......
......@@ -71,7 +71,7 @@
<span style="margin-right: 10px;">
<auth-button :data="getAuthButtonData(scope.scope)" :show-btn-ids="['9030703']" />
</span>
<auth-button v-if="!scope.scope.goodsInfo || scope.scope.goodsInfo.scrmFlag !== 'Y'"
<auth-button v-if="(!scope.scope.goodsInfo || scope.scope.goodsInfo.scrmFlag !== 'Y') && !scope.scope.isLastSku"
:data="getAuthButtonData(scope.scope)"
:show-btn-ids="['9030706']" />
</div>
......@@ -305,7 +305,7 @@ export default {
width: "120",
}, {
label: "计价单位",
prop: "listShowPricingUnit",
prop: "priceUnitName",
width: "90",
}, {
label: "采购成本/元",
......@@ -523,6 +523,13 @@ export default {
const isSkuMode = this.searchForm.showSkuMode === "Y";
// 新 SPU 接口不返回 upgradeGoodsList,标记为 SPU 平铺模式
this.spuOnlyMode = !listData.some(item => item.upgradeGoodsList && item.upgradeGoodsList.length);
const baseGoodsIdCount = {};
if (isSkuMode) {
listData.forEach((item) => {
const bid = item.baseGoodsId || item.id;
baseGoodsIdCount[bid] = (baseGoodsIdCount[bid] || 0) + 1;
});
}
listData.forEach((val) => {
if (!val.goodsInfo)
val.goodsInfo = {};
......@@ -561,6 +568,7 @@ export default {
v.listShowApplicableArea = this._pickFirst("-", v.applicableArea, v.goodsInfo && v.goodsInfo.applicableArea, val.goodsInfo && val.goodsInfo.applicableArea);
const accessoryType = (v.goodsInfo && v.goodsInfo.accessoryType != null) ? v.goodsInfo.accessoryType : ((val.goodsInfo && val.goodsInfo.accessoryType != null) ? val.goodsInfo.accessoryType : v.accessoryType);
v.listShowPartsNature = this._formatAccessoryType(accessoryType);
v.isLastSku = val.upgradeGoodsList.length === 1;
});
// SPU 父级:规格取 spuSpecificationData,参考售价取 spuUpgradePrice
val.listShowSpecificationData = (val.spuSpecificationData != null && val.spuSpecificationData !== "") ? val.spuSpecificationData : "-";
......@@ -571,6 +579,7 @@ export default {
this._setParentRowFromFirstSku(val, val.upgradeGoodsList[0]);
} else if (isSkuMode) {
// Y 模式:listData 直接为 SKU 平铺,逐条处理
val.isLastSku = (baseGoodsIdCount[val.baseGoodsId || val.id] || 0) === 1;
this._processSkuItem(val, val, null);
} else {
this._setSpuOnlyDefaults(val);
......
......@@ -115,6 +115,8 @@ export default {
if (this.addOrEdit === "edit") {
this.getGoodsInfo(this.$route.query.id);
} else {
// 新增时清空 Vuex 中的 SKU 数据,避免缓存上一个编辑商品的数据
this.setUpdateGoodsInfo(deepClone(this.resetData));
this.$nextTick(() => {
this.show = true;
});
......@@ -545,8 +547,12 @@ export default {
}
return item;
});
this.goodsInfoData.goodsSpecificationList = arr;
this.goodsInfoData.goodsSpecificationSingleList = arr;
// 仅更新当前规格类型对应的列表,避免互相覆盖导致数据错乱
if (this.goodsInfoData.specificationType == 1) {
this.setUpdateGoodsInfo({ goodsSpecificationSingleList: arr });
} else {
this.setUpdateGoodsInfo({ goodsSpecificationList: arr });
}
let specialList = [];
if (this.goodsInfoData.goodsType == 1) { // 太阳膜 位置 质保 采购价 必填 + 新增字段(配件性质从 SPU 同步)
specialList = ["position", "purchasePrice", "warrantyPeriod", "type", "priceUnitType", "purchaseCost"];
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!