Commit 066f9188 by 陈婉清

Merge branch 'feature/584/cwq' into 'SAAS+V5.8.4'

Feature/584/cwq

See merge request !913
2 parents 6b9658b2 b42aeae1
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
:key="form.categoryType" :key="form.categoryType"
v-model="form.goodsTypeGroupRelationList" v-model="form.goodsTypeGroupRelationList"
placeholder="请选择商品" placeholder="请选择商品"
style="width:390px" style="width:800px"
value-key="merchantGoodsCode" value-key="merchantGoodsCode"
disabled disabled
:fetch-api="fetchUpgradeGoodsList" :fetch-api="fetchUpgradeGoodsList"
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
ref="packageGoods" ref="packageGoods"
v-model="form.goodsTypeGroupRelationList" v-model="form.goodsTypeGroupRelationList"
placeholder="请选择套餐" placeholder="请选择套餐"
style="width:390px" style="width:800px"
value-key="packageCode" value-key="packageCode"
disabled disabled
:fetch-api="getPackagesGoodsList" :fetch-api="getPackagesGoodsList"
......
...@@ -139,7 +139,9 @@ ...@@ -139,7 +139,9 @@
</el-row> </el-row>
</el-form> </el-form>
<div class="actions-wrapper"> <div class="actions-wrapper">
<el-button type="text" @click="handleAppendProduct"> <el-button v-if="shelfModel === 2"
type="text"
@click="handleAppendProduct">
<span class="el-icon-plus" /> <span class="el-icon-plus" />
添加商品 添加商品
</el-button> </el-button>
...@@ -157,6 +159,7 @@ ...@@ -157,6 +159,7 @@
:merchant-id="merchantId" :merchant-id="merchantId"
:merchant-id-list="merchantIdList" :merchant-id-list="merchantIdList"
:product.sync="productList[index]" :product.sync="productList[index]"
:shelf-model="shelfModel"
:shelf-type="shelfType" :shelf-type="shelfType"
:show-gift-cost="false" :show-gift-cost="false"
:show-old-merchant-goods-code="false" :show-old-merchant-goods-code="false"
...@@ -217,6 +220,11 @@ export default { ...@@ -217,6 +220,11 @@ export default {
type: Number, type: Number,
default: 1, default: 1,
}, },
/** 1-特殊上架;2-常规上架 */
shelfModel: {
type: Number,
default: 1,
},
}, },
data() { data() {
return { return {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<el-button icon="el-icon-plus" @click="handleSelectGoods"> <el-button icon="el-icon-plus" @click="handleSelectGoods">
选择商品 选择商品
</el-button> </el-button>
<el-button v-if="useRemoveBtn" <el-button v-if="useRemoveBtn && shelfModel === 2"
type="text" type="text"
@click="handleRemove"> @click="handleRemove">
删除 删除
...@@ -189,12 +189,12 @@ ...@@ -189,12 +189,12 @@
<el-col v-if="isMemberRightsUpgrade(baseSceneCode)" :span="12"> <el-col v-if="isMemberRightsUpgrade(baseSceneCode)" :span="12">
<el-form-item label="第三方成本/件:" <el-form-item label="第三方成本/件:"
prop="detailList[0].thirdPartyCost" prop="detailList[0].thirdPartyCost"
:rules="[{ required: true, message: '请输入第三方成本', trigger: 'blur' }]"> :rules="[{ required: isUpgradeProductCostStyleDefault(product.detailList[0].thirdPartyCostStyle) ? false : true, message: '请输入第三方成本', trigger: 'blur' }]">
<div class="form-item-append-fix"> <div class="form-item-append-fix">
<VenusNumberInput v-model="product.detailList[0].thirdPartyCost" <VenusNumberInput v-model="product.detailList[0].thirdPartyCost"
placeholder="请输入第三方成本" placeholder="请输入第三方成本"
:controls="false" :controls="false"
:disabled="isUpgradeProductCostStyleDefault(product.detailList[0].upgradeProductCostStyle) || isDirectOperation(product.detailList[0].supplyFlag)" :disabled="isUpgradeProductCostStyleDefault(product.detailList[0].thirdPartyCostStyle) || isDirectOperation(product.detailList[0].supplyFlag)"
:max="999999" :max="999999"
:min="0" :min="0"
:precision="2" /> :precision="2" />
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
<el-col v-if="isQualityUpgrade(baseSceneCode)" :span="12"> <el-col v-if="isQualityUpgrade(baseSceneCode)" :span="12">
<el-form-item label="产品、升级成本:" <el-form-item label="产品、升级成本:"
prop="detailList[0].upgradeProductCost" prop="detailList[0].upgradeProductCost"
:rules="[{ required: true, message: '请输入产品、升级成本', trigger: 'blur' }]"> :rules="[{ required: isUpgradeProductCostStyleDefault(product.detailList[0].upgradeProductCostStyle) ? false : true, message: '请输入产品、升级成本', trigger: 'blur' }]">
<div class="form-item-append-fix"> <div class="form-item-append-fix">
<VenusNumberInput v-model="product.detailList[0].upgradeProductCost" <VenusNumberInput v-model="product.detailList[0].upgradeProductCost"
placeholder="请输入产品、升级成本" placeholder="请输入产品、升级成本"
...@@ -220,11 +220,12 @@ ...@@ -220,11 +220,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 精品升级:取upgradeProductCostStyle,与“产品、升级成本/件”有联动关系;会员权益:取thirdPartyCostStyle,与“第三方成本/件”有联动关系 -->
<el-col v-if="showUpgradeProductCostStyle" :span="12"> <el-col v-if="showUpgradeProductCostStyle" :span="12">
<el-form-item label="产品成本获取方式:" <el-form-item label="产品成本获取方式:"
prop="detailList[0].upgradeProductCostStyle" :prop="isQualityUpgrade(baseSceneCode) ? 'detailList[0].upgradeProductCostStyle' : 'detailList[0].thirdPartyCostStyle'"
:rules="[{ required: true, message: '请选择产品成本获取方式', trigger: 'change' }]"> :rules="[{ required: true, message: '请选择产品成本获取方式', trigger: 'change' }]">
<el-radio-group v-model="product.detailList[0].upgradeProductCostStyle" <el-radio-group v-model="productCostStyleValue"
@change="handleUpgradeProductCostStyleChange"> @change="handleUpgradeProductCostStyleChange">
<template v-for="item in options.productCostStyleOpt"> <template v-for="item in options.productCostStyleOpt">
<el-radio :key="item.value" <el-radio :key="item.value"
...@@ -323,6 +324,11 @@ export default { ...@@ -323,6 +324,11 @@ export default {
type: Number, type: Number,
default: 1, default: 1,
}, },
/** 1-特殊上架;2-常规上架 */
shelfModel: {
type: Number,
default: 1,
},
merchantIdList: { merchantIdList: {
type: Array, type: Array,
required: true, required: true,
...@@ -384,6 +390,20 @@ export default { ...@@ -384,6 +390,20 @@ export default {
}, },
computed: { computed: {
productCostStyleValue: {
get() {
return isQualityUpgrade(this.baseSceneCode)
? this.product.detailList[0].upgradeProductCostStyle
: this.product.detailList[0].thirdPartyCostStyle;
},
set(value) {
if (isQualityUpgrade(this.baseSceneCode)) {
this.product.detailList[0].upgradeProductCostStyle = value;
return;
}
this.product.detailList[0].thirdPartyCostStyle = value;
},
},
showUpgradeProductCostStyle() { showUpgradeProductCostStyle() {
// 未选择产品 不显示 // 未选择产品 不显示
if (!(this.product.upgradeGoodsId || this.product.detailList[0].upgradeGoodsId)) { if (!(this.product.upgradeGoodsId || this.product.detailList[0].upgradeGoodsId)) {
...@@ -472,7 +492,7 @@ export default { ...@@ -472,7 +492,7 @@ export default {
// 产品成本获取方式变动 更新成本 // 产品成本获取方式变动 更新成本
async updateCost() { async updateCost() {
// 如果是自定义成本带入方式 则 不更新成本 // 如果是自定义成本带入方式 则 不更新成本
if (isUpgradeProductCostStyleCustom(this.product?.detailList?.[0]?.upgradeProductCostStyle)) { if (isUpgradeProductCostStyleCustom(this.productCostStyleValue)) {
return; return;
} }
...@@ -489,15 +509,15 @@ export default { ...@@ -489,15 +509,15 @@ export default {
// 如果是会员权益升级场景 // 如果是会员权益升级场景
if (isMemberRightsUpgrade(this.baseSceneCode)) { if (isMemberRightsUpgrade(this.baseSceneCode)) {
this.product.detailList[0].thirdPartyCost = equityOperationCost ?? 0; this.product.detailList[0].thirdPartyCost = equityOperationCost;
} }
// 如果是精品升级场景 // 如果是精品升级场景
if (isQualityUpgrade(this.baseSceneCode)) { if (isQualityUpgrade(this.baseSceneCode)) {
this.product.detailList[0].upgradeProductCost = upgradeCost ?? 0; this.product.detailList[0].upgradeProductCost = upgradeCost;
// 如果 是否作为赠送产品 // 如果 是否作为赠送产品
if (this.product.detailList[0].isGiftCost === "Y") { if (this.product.detailList[0].isGiftCost === "Y") {
this.product.detailList[0].giftCost = upgradeCost ?? 0; this.product.detailList[0].giftCost = upgradeCost;
} }
} }
}, },
...@@ -524,7 +544,7 @@ export default { ...@@ -524,7 +544,7 @@ export default {
* 选择商品时 * 选择商品时
*/ */
async handleSelectGoodsConfirm(upgradeGoods) { async handleSelectGoodsConfirm(upgradeGoods) {
upgradeGoods.djCost = upgradeGoods.djCost ?? 0; // upgradeGoods.djCost = upgradeGoods.djCost ?? 0;
upgradeGoods.positionList = []; upgradeGoods.positionList = [];
if (upgradeGoods.position) { if (upgradeGoods.position) {
upgradeGoods.positionList = upgradeGoods.position.split(",").map(Number); upgradeGoods.positionList = upgradeGoods.position.split(",").map(Number);
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
:merchant-id-list="merchantIdList" :merchant-id-list="merchantIdList"
:packages="productDetail || { detailList: [] }" :packages="productDetail || { detailList: [] }"
:prefix="$data._prefix" :prefix="$data._prefix"
:shelf-model="shelfModel"
:shelf-type="shelfType" :shelf-type="shelfType"
@update:packages="handleComboUpdatePackages" /> @update:packages="handleComboUpdatePackages" />
</div> </div>
......
...@@ -254,12 +254,16 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -254,12 +254,16 @@ export async function getProductDetailDescriptionSchema(shelfType) {
}, },
}, },
/**
* 精品升级:取upgradeProductCostStyle,与“产品、升级成本/件”有联动关系;
* 会员权益:取thirdPartyCostStyle,与“第三方成本/件”有联动关系
*/
{ {
name: "detailList.0.upgradeProductCostStyle", name: "detailList.0.upgradeProductCostStyle",
label: "产品成本获取方式", label: "产品成本获取方式",
col: 12, col: 12,
render(h, { data, schemaItem }) { render(h, { data, schemaItem }) {
const value = get(data, schemaItem.name); const value = get(data, isQualityUpgrade(data.baseSceneCode) ? schemaItem.name : "detailList.0.thirdPartyCostStyle");
const item = productCostStyleOpt.find(item => item.value === value); const item = productCostStyleOpt.find(item => item.value === value);
return h( return h(
"span", "span",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!