Commit 31f43f7e by wangzhihui

上架管理需求开发

1 parent a103ef5a
...@@ -733,7 +733,7 @@ export default { ...@@ -733,7 +733,7 @@ export default {
{ {
required: true, required: true,
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (!shouldShowPosition(this.formData.goodsType)) { if (!this.shouldShowPosition(this.formData.goodsType)) {
callback(); callback();
return; return;
} }
...@@ -948,6 +948,7 @@ export default { ...@@ -948,6 +948,7 @@ export default {
}, },
methods: { methods: {
shouldShowPosition,
...mapActions({ ...mapActions({
get: "d2admin/base/get", get: "d2admin/base/get",
}), }),
...@@ -1199,6 +1200,9 @@ export default { ...@@ -1199,6 +1200,9 @@ export default {
) { ) {
spliceForm.push("productCostType"); spliceForm.push("productCostType");
} }
if (!shouldShowPosition(formData?.goodsType)) {
spliceForm.push("position");
}
const newForm = shopForm.filter((v) => !spliceForm?.includes(v.name)); const newForm = shopForm.filter((v) => !spliceForm?.includes(v.name));
this.$set(this.formList[1], "formBlock", newForm); this.$set(this.formList[1], "formBlock", newForm);
this.$nextTick(() => { this.$nextTick(() => {
...@@ -1232,20 +1236,23 @@ export default { ...@@ -1232,20 +1236,23 @@ export default {
upgradeSupplyModeList upgradeSupplyModeList
); );
} }
// 上架部位 }
// 膜类(太阳膜/改色膜/车衣)上架部位选项
if (shouldShowPosition(formData?.goodsType)) {
this.positionTypeList?.forEach((val) => { this.positionTypeList?.forEach((val) => {
val.confId = val.position; val.confId = val.position;
}); });
this.$set( const positionIndex = this.formList[1].formBlock.findIndex(
this.formList[1].formBlock[
this.formList[1].formBlock.findIndex(
(subItem) => subItem.name == "position" (subItem) => subItem.name == "position"
) );
], if (positionIndex > -1) {
this.$set(
this.formList[1].formBlock[positionIndex],
"radioGroupList", "radioGroupList",
this.positionTypeList || [] this.positionTypeList || []
); );
} }
}
// 当产品信息自带嘀加成本时,将输入框置灰 // 当产品信息自带嘀加成本时,将输入框置灰
if ( if (
!this.filterEmpty(formData?.upgradeGoods?.djCost) && !this.filterEmpty(formData?.upgradeGoods?.djCost) &&
......
...@@ -409,6 +409,7 @@ export default { ...@@ -409,6 +409,7 @@ export default {
}); });
}); });
this.positionTypeList = await this.get(BaseData.positionTypeList); this.positionTypeList = await this.get(BaseData.positionTypeList);
console.log(this.positionTypeList,'positionTypeList');
}, },
getDetailInfo(id) { getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(async (res) => { getMerchantGoodsInfo({ id }).then(async (res) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!