Commit 9b0352c6 by Jaxon

feat(商品上架): 业务开发

1 parent 5868d21c
...@@ -109,7 +109,6 @@ export default { ...@@ -109,7 +109,6 @@ export default {
}, },
value: { value: {
required: true, required: true,
type: [Array, String, Number],
}, },
fieldName: { fieldName: {
type: Object, type: Object,
...@@ -236,8 +235,7 @@ export default { ...@@ -236,8 +235,7 @@ export default {
}); });
} }
}, },
handleSelectChange(e) { handleSelectChange(e, d) {
console.log("handleSelectChange", e);
this.$emit("input", e); this.$emit("input", e);
if (isFunction(this.$listeners?.change)) { if (isFunction(this.$listeners?.change)) {
this.$listeners.change(e); this.$listeners.change(e);
......
...@@ -207,3 +207,9 @@ export function postProductServiceList(data = {}) { ...@@ -207,3 +207,9 @@ export function postProductServiceList(data = {}) {
data.categoryId = 1; data.categoryId = 1;
return getServiceItem(data); return getServiceItem(data);
} }
// 获取 服务项目
export function postProductCostCalculateApi(data = {}) {
data.method = "dj.api.smartcarlife.merchantGoodsInfo.productCost.calculate";
return request(data, RequestMethods.POST);
}
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
:merchant-id-list="merchantIdList" :merchant-id-list="merchantIdList"
:product="productData" :product="productData"
:shelf-type="shelfType" :shelf-type="shelfType"
:show-business-line="false" :show-business-line="false"
:show-gift-cost="false" :show-gift-cost="false"
:show-old-merchant-goods-code="false" :show-old-merchant-goods-code="false"
...@@ -19,7 +18,6 @@ ...@@ -19,7 +18,6 @@
:show-sales-proportion-percent="false" :show-sales-proportion-percent="false"
:show-settlement-type="false" :show-settlement-type="false"
:show-shelf-style="false" :show-shelf-style="false"
@update:upgradeGoods="handleUpdateProduct($event, index)" /> @update:upgradeGoods="handleUpdateProduct($event, index)" />
<el-divider class="divider"></el-divider> <el-divider class="divider"></el-divider>
</div> </div>
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
placeholder="原上架ID" placeholder="原上架ID"
:fetch-api="fetchMerchantGoodsCode" :fetch-api="fetchMerchantGoodsCode"
:field-name="{ :field-name="{
value: 'goodsCode', value: 'packageId',
label: 'productName', label: 'packageId',
}" }"
:immediate="true" :immediate="true"
:multiple="false" :multiple="false"
...@@ -135,21 +135,6 @@ ...@@ -135,21 +135,6 @@
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col v-if="isQualityUpgrade(baseSceneCode)"
title="按子商品的回收成本进行累计,实时计算"
:span="12">
<el-form-item label="回收成本:" prop="recoveryCost">
<div class="form-item-append-fix">
<VenusNumberInput disabled
:controls="false"
:min="0"
:precision="2"
:value="getSumValue.totalRecoveryCost">
</VenusNumberInput>
<span class="fix-symbol">元</span>
</div>
</el-form-item>
</el-col> -->
</el-row> </el-row>
</el-form> </el-form>
...@@ -192,6 +177,7 @@ ...@@ -192,6 +177,7 @@
import { cloneDeep, isFunction, pick, reduce } from "lodash-es"; import { cloneDeep, isFunction, pick, reduce } from "lodash-es";
import { nanoid } from "nanoid"; import { nanoid } from "nanoid";
import { settlementTypeOpt } from "@/common/constants.js"; import { settlementTypeOpt } from "@/common/constants.js";
import RemoteSelect from "@/components/remoteSearchSelect/index.vue";
import VenusNumberInput from "@/components/venusNumberInput/index.vue"; import VenusNumberInput from "@/components/venusNumberInput/index.vue";
import { baseConfig } from "@/main"; import { baseConfig } from "@/main";
import { postComboOldMerchantGoodsCodeList } from "@/views/goods/shelfProduct/api"; import { postComboOldMerchantGoodsCodeList } from "@/views/goods/shelfProduct/api";
...@@ -204,6 +190,7 @@ export default { ...@@ -204,6 +190,7 @@ export default {
components: { components: {
Product, Product,
VenusNumberInput, VenusNumberInput,
RemoteSelect,
}, },
props: { props: {
merchantIdList: { merchantIdList: {
...@@ -211,7 +198,7 @@ export default { ...@@ -211,7 +198,7 @@ export default {
required: true, required: true,
}, },
merchantId: { merchantId: {
type: Number, type: [Number, Array],
required: true, required: true,
}, },
baseSceneCode: { baseSceneCode: {
...@@ -307,7 +294,7 @@ export default { ...@@ -307,7 +294,7 @@ export default {
async fetchMerchantGoodsCode({ pageQuery }) { async fetchMerchantGoodsCode({ pageQuery }) {
const res = await postComboOldMerchantGoodsCodeList({ const res = await postComboOldMerchantGoodsCodeList({
...pageQuery, ...pageQuery,
merchantIds: [this.merchantId], merchantIds: Array.isArray(this.merchantId) ? this.merchantId : [this.merchantId],
baseSceneCode: this.baseSceneCode, baseSceneCode: this.baseSceneCode,
productName: pageQuery.searchValue, productName: pageQuery.searchValue,
}); });
......
...@@ -68,18 +68,23 @@ export default { ...@@ -68,18 +68,23 @@ export default {
computed: { computed: {
filterSchema() { filterSchema() {
return this.schema.filter((item) => { return this.schema.filter((item) => {
// 结算方式
if (item.name === "settlementType") { if (item.name === "settlementType") {
return this.showSettlementType; return this.showSettlementType;
} }
// 销售占比
if (item.name === "salesProportionPercent") { if (item.name === "salesProportionPercent") {
return this.showSalesProportionPercent; return this.showSalesProportionPercent;
} }
// 上架类型
if (item.name === "shelfStyle") { if (item.name === "shelfStyle") {
return this.showShelfStyle; return this.showShelfStyle;
} }
// 原上架id
if (item.name === "oldMerchantGoodsCode") { if (item.name === "oldMerchantGoodsCode") {
return this.showOldMerchantGoodsCode; return this.showOldMerchantGoodsCode;
} }
// 赠送成本
if (item.name === "detailList.0.giftCost") { if (item.name === "detailList.0.giftCost") {
return this.showGiftCost; return this.showGiftCost;
} }
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
:fetch-api="fetchMerchantGoodsCode" :fetch-api="fetchMerchantGoodsCode"
:field-name="{ :field-name="{
value: 'goodsCode', value: 'goodsCode',
label: 'productName', label: 'goodsCode',
}" }"
:immediate="true" :immediate="true"
:multiple="false" :multiple="false"
...@@ -103,7 +103,6 @@ ...@@ -103,7 +103,6 @@
:rules="[{ required: true, message: '请选择服务项目', trigger: 'change' }]"> :rules="[{ required: true, message: '请选择服务项目', trigger: 'change' }]">
<RemoteSelect v-model="product.detailList[0].serviceItemId" <RemoteSelect v-model="product.detailList[0].serviceItemId"
placeholder="请选择服务项目" placeholder="请选择服务项目"
value-key="id"
:fetch-api="fetchServiceListItem" :fetch-api="fetchServiceListItem"
:field-name="{ :field-name="{
value: 'id', value: 'id',
...@@ -111,7 +110,8 @@ ...@@ -111,7 +110,8 @@
}" }"
:immediate="true" :immediate="true"
:multiple="false" :multiple="false"
:options.sync="options.serviceList"> :options.sync="options.serviceList"
@change="handlesServiceItemChange">
</RemoteSelect> </RemoteSelect>
</el-form-item> </el-form-item>
...@@ -144,20 +144,6 @@ ...@@ -144,20 +144,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col v-if="showSalesProportionPercent" :span="12">
<el-form-item label="销售占比:" prop="salesProportionPercent">
<div class="form-item-append-fix">
<VenusNumberInput v-model="product.salesProportionPercent"
placeholder="请输入销售占比"
:controls="false"
:max="100"
:min="0"
:precision="2">
</VenusNumberInput>
<span class="fix-symbol">%</span>
</div>
</el-form-item> -->
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="售价/件:" <el-form-item label="售价/件:"
prop="detailList[0].sellPrice" prop="detailList[0].sellPrice"
...@@ -208,7 +194,7 @@ ...@@ -208,7 +194,7 @@
<VenusNumberInput v-model="product.detailList[0].thirdPartyCost" <VenusNumberInput v-model="product.detailList[0].thirdPartyCost"
placeholder="请输入第三方成本" placeholder="请输入第三方成本"
:controls="false" :controls="false"
:disabled="isUpgradeProductCostStyleDefault(product.upgradeProductCostStyle) || isDirectOperation(product.detailList[0].supplyFlag)" :disabled="isUpgradeProductCostStyleDefault(product.detailList[0].upgradeProductCostStyle) || isDirectOperation(product.detailList[0].supplyFlag)"
:max="999999" :max="999999"
:min="0" :min="0"
:precision="2" /> :precision="2" />
...@@ -224,7 +210,7 @@ ...@@ -224,7 +210,7 @@
<VenusNumberInput v-model="product.detailList[0].upgradeProductCost" <VenusNumberInput v-model="product.detailList[0].upgradeProductCost"
placeholder="请输入产品、升级成本" placeholder="请输入产品、升级成本"
:controls="false" :controls="false"
:disabled="isUpgradeProductCostStyleDefault(product.upgradeProductCostStyle)" :disabled="isUpgradeProductCostStyleDefault(product.detailList[0].upgradeProductCostStyle)"
:max="999999" :max="999999"
:min="0" :min="0"
:precision="2"> :precision="2">
...@@ -234,9 +220,23 @@ ...@@ -234,9 +220,23 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col v-if="showUpgradeProductCostStyle" :span="12">
<el-form-item label="商品成本带入方式:"
prop="detailList[0].upgradeProductCostStyle"
:rules="[{ required: true, message: '请选择商品成本带入方式', trigger: 'change' }]">
<el-radio-group v-model="product.detailList[0].upgradeProductCostStyle"
@change="handleUpgradeProductCostStyleChange">
<template v-for="item in options.productCostStyleOpt">
<el-radio :key="item.value"
:label="item.value">
{{ item.label }}
</el-radio>
</template>
</el-radio-group>
</el-form-item>
</el-col>
<!-- ●赠送成本(仅精品升级场景存在) --> <!-- ●赠送成本(仅精品升级场景存在) -->
<!-- TODO 5.8.6 ○若否则默认为空 -->
<!-- TODO 5.8.6 ○若是则自动带入对应的产品、升级成本,成本的获取方式与产品、升级成本一致; -->
<el-col v-if="isQualityUpgrade(baseSceneCode) && showGiftCost" :span="12"> <el-col v-if="isQualityUpgrade(baseSceneCode) && showGiftCost" :span="12">
<el-form-item label="赠送成本:" <el-form-item label="赠送成本:"
prop="detailList[0].giftCost"> prop="detailList[0].giftCost">
...@@ -271,10 +271,20 @@ import { BaseData, settlementTypeOpt } from "@/common/constants.js"; ...@@ -271,10 +271,20 @@ import { BaseData, settlementTypeOpt } from "@/common/constants.js";
import Descriptions from "@/components/descriptions/index.vue"; import Descriptions from "@/components/descriptions/index.vue";
import RemoteSelect from "@/components/remoteSearchSelect/index.vue"; import RemoteSelect from "@/components/remoteSearchSelect/index.vue";
import VenusNumberInput from "@/components/venusNumberInput/index.vue"; import VenusNumberInput from "@/components/venusNumberInput/index.vue";
import { postProductOldMerchantGoodsCodeList, postProductServiceList } from "@/views/goods/shelfProduct/api"; import {
postProductCostCalculateApi,
postProductOldMerchantGoodsCodeList,
postProductServiceList,
} from "@/views/goods/shelfProduct/api";
import SelectGoodsDialog from "@/views/goods/shelfProduct/components/shelfProductConfirm/components/selectGoods/index.vue"; import SelectGoodsDialog from "@/views/goods/shelfProduct/components/shelfProductConfirm/components/selectGoods/index.vue";
import { getProductDetailUpgradeGoodsDescriptionSchema } from "@/views/goods/shelfProduct/components/shelfProductConfirm/shelfProductConfirm.data.js"; import {
import { inventoryTypeOption, shelfStyleOptions } from "@/views/goods/shelfProduct/constant/index.js"; getProductDetailUpgradeGoodsDescriptionSchema,
} from "@/views/goods/shelfProduct/components/shelfProductConfirm/shelfProductConfirm.data.js";
import {
inventoryTypeOption,
productCostStyleOpt,
shelfStyleOptions,
} from "@/views/goods/shelfProduct/constant/index.js";
import { import {
isDirectOperation, isDirectOperation,
isMemberRightsUpgrade, isMemberRightsUpgrade,
...@@ -301,7 +311,7 @@ export default { ...@@ -301,7 +311,7 @@ export default {
required: true, required: true,
}, },
merchantId: { merchantId: {
type: Number, type: [Number, Array],
required: true, required: true,
}, },
baseSceneCode: { baseSceneCode: {
...@@ -358,6 +368,7 @@ export default { ...@@ -358,6 +368,7 @@ export default {
settlementType: settlementTypeOpt, settlementType: settlementTypeOpt,
inventoryType: inventoryTypeOption, inventoryType: inventoryTypeOption,
shelfStyleOptions, shelfStyleOptions,
productCostStyleOpt,
position: [], position: [],
serviceList: [], serviceList: [],
oldMerchantGoodsCode: [], oldMerchantGoodsCode: [],
...@@ -372,7 +383,22 @@ export default { ...@@ -372,7 +383,22 @@ export default {
}; };
}, },
computed: {}, computed: {
showUpgradeProductCostStyle() {
// 未选择产品 不显示
if (!(this.product.upgradeGoodsId || this.product.detailList[0].upgradeGoodsId)) {
return false;
}
//
if (isSolarFilm(this.product?.detailList?.[0]?.upgradeGoods?.goodsInfo?.goodsType)) {
// 如果是膜类 还要额外判断 服务项目未选择的时候 也不显示
if (!this.product?.detailList?.[0]?.serviceItemId) {
return false;
}
}
return true;
},
},
watch: { watch: {
product: { product: {
handler(val) { handler(val) {
...@@ -406,15 +432,11 @@ export default { ...@@ -406,15 +432,11 @@ export default {
isDirectOperation, isDirectOperation,
async initOptions() { async initOptions() {
this.options.position = await this.get(BaseData.positionTypeList); this.options.position = await this.get(BaseData.positionTypeList);
this.options.oldMerchantGoodsCode = await postProductOldMerchantGoodsCodeList({
merchantIds: [this.merchantId],
baseSceneCode: this.baseSceneCode,
});
}, },
async fetchMerchantGoodsCode({ pageQuery }) { async fetchMerchantGoodsCode({ pageQuery }) {
const res = await postProductOldMerchantGoodsCodeList({ const res = await postProductOldMerchantGoodsCodeList({
...pageQuery, ...pageQuery,
merchantIds: [this.merchantId], merchantIds: Array.isArray(this.merchantId) ? this.merchantId : [this.merchantId],
baseSceneCode: this.baseSceneCode, baseSceneCode: this.baseSceneCode,
productName: pageQuery.searchValue, productName: pageQuery.searchValue,
}); });
...@@ -430,6 +452,7 @@ export default { ...@@ -430,6 +452,7 @@ export default {
return await postProductServiceList({ ...pageQuery, serviceItemsName: pageQuery.searchValue, return await postProductServiceList({ ...pageQuery, serviceItemsName: pageQuery.searchValue,
}); });
}, },
showPositionItem(position) { showPositionItem(position) {
return this.product?.detailList[0]?.upgradeGoods?.positionList?.includes(position); return this.product?.detailList[0]?.upgradeGoods?.positionList?.includes(position);
}, },
...@@ -446,15 +469,62 @@ export default { ...@@ -446,15 +469,62 @@ export default {
this.dialog.selectGoods.show = false; this.dialog.selectGoods.show = false;
}, },
handleSelectGoodsConfirm(upgradeGoods) { // 商品成本带入方式变动 更新成本
// 库存-sku001 async updateCost() {
// 如果是自定义成本带入方式 则 不更新成本
if (isUpgradeProductCostStyleCustom(this.product?.detailList?.[0]?.upgradeProductCostStyle)) {
return;
}
// 权益延保第三方成本 equityOperationCost;
// 轻改产品升级成本 upgradeCost;
const { equityOperationCost, upgradeCost } = await postProductCostCalculateApi({
serviceItemId: this.product?.detailList?.[0]?.serviceItemId,
upgradeGoodsId: this.product.upgradeGoodsId || this.product.detailList[0].upgradeGoodsId,
});
// 如果是会员权益升级场景
if (isMemberRightsUpgrade(this.baseSceneCode)) {
this.product.detailList[0].thirdPartyCost = equityOperationCost;
}
// 如果是精品升级场景
if (isQualityUpgrade(this.baseSceneCode)) {
this.product.detailList[0].upgradeProductCost = upgradeCost;
// 如果 是否作为赠送产品
if (this.product.detailList[0].isGiftCost === "Y") {
this.product.detailList[0].giftCost = upgradeCost;
}
}
},
/**
* 商品成本带入方式 变更
*/
async handleUpgradeProductCostStyleChange(e) {
await this.$nextTick();
await this.updateCost();
},
/**
* 服务项目 变更
*/
async handlesServiceItemChange(e) {
const serviceItem = this.options.serviceList.find(item => item.id === e);
// 同步更改名字
if (serviceItem) {
this.product.detailList[0].serviceItem = serviceItem.serviceItemsName;
}
await this.$nextTick();
await this.updateCost();
},
/**
* 选择商品时
*/
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);
} }
this.$emit("update:upgradeGoods", upgradeGoods); this.$emit("update:upgradeGoods", upgradeGoods);
await this.$nextTick();
await this.updateCost();
this.handleSelectGoodsClose(); this.handleSelectGoodsClose();
}, },
async validate() { async validate() {
......
...@@ -22,15 +22,17 @@ ...@@ -22,15 +22,17 @@
<span class="label"> <span class="label">
{{ row.productName }} {{ row.productName }}
</span> </span>
<span v-if="useEdit && isView(editState)" <!-- 5.8.4 不允许删除 -->
<!-- <span v-if="useEdit && isView(editState)"
class="actions el-icon-close" class="actions el-icon-close"
@click.stop="handleRemoveTitleSelectItem(row)"> @click.stop="handleRemoveTitleSelectItem(row)">
</span> </span> -->
</div> </div>
</template> </template>
</RemoteSelect> </RemoteSelect>
</div> </div>
<div v-if="useEdit && isView(editState)" class="actions-wrapper"> <!-- 5.8.4 取消新增功能 -->
<!-- <div v-if="useEdit && isView(editState)" class="actions-wrapper">
<el-dropdown @command="handleAppendProductPackages"> <el-dropdown @command="handleAppendProductPackages">
<el-button size="small" plain> <el-button size="small" plain>
新增 新增
...@@ -47,7 +49,7 @@ ...@@ -47,7 +49,7 @@
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
</div> </div> -->
</div> </div>
<div class="content-wrapper"> <div class="content-wrapper">
...@@ -154,7 +156,7 @@ export default { ...@@ -154,7 +156,7 @@ export default {
required: true, required: true,
}, },
merchantId: { merchantId: {
type: Number, type: [Number, Array],
required: true, required: true,
}, },
shelfType: { shelfType: {
......
...@@ -65,7 +65,6 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -65,7 +65,6 @@ export async function getProductDetailDescriptionSchema(shelfType) {
}, },
isHide({ formModel }) { isHide({ formModel }) {
const goodsType = getUpgradeGoods(formModel)?.goodsInfo?.goodsType; const goodsType = getUpgradeGoods(formModel)?.goodsInfo?.goodsType;
// 不是太阳膜类型的 隐藏 // 不是太阳膜类型的 隐藏
return !(isSolarFilm(goodsType)); return !(isSolarFilm(goodsType));
}, },
...@@ -83,7 +82,7 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -83,7 +82,7 @@ export async function getProductDetailDescriptionSchema(shelfType) {
); );
}, },
isHide({ formModel }) { isHide({ formModel }) {
// 单店模式才存在; // 单店模式存在
return !(isSingleShopMode(shelfType)); return !(isSingleShopMode(shelfType));
}, },
}, },
...@@ -93,16 +92,15 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -93,16 +92,15 @@ export async function getProductDetailDescriptionSchema(shelfType) {
label: "原上架ID", label: "原上架ID",
col: 12, col: 12,
render(h, { data, schemaItem }) { render(h, { data, schemaItem }) {
// const value = get(data, schemaItem.name); const value = get(data, schemaItem.name);
// const item = value && shelfStyleOptions.find(item => item.value === value);
return h( return h(
"span", "span",
"动态获取" || "-", value || "-",
); );
}, },
isHide({ formModel }) { isHide({ formModel }) {
// 单店模式 且 shelfStyle === 修改才存在 // 单店模式 且 shelfStyle === 修改才存在
return !(isSingleShopMode(shelfType) && !isShelfStyleEdit(formModel.shelfStyle)); return !(isSingleShopMode(shelfType) && isShelfStyleEdit(formModel.shelfStyle));
}, },
}, },
...@@ -124,6 +122,31 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -124,6 +122,31 @@ export async function getProductDetailDescriptionSchema(shelfType) {
); );
}, },
}, },
{
name: "detailList.0.serviceItem",
label: "服务项目",
col: 12,
render(h, { data, schemaItem }) {
const value = get(data, schemaItem.name);
return h(
"div",
{
attrs: {
title: value,
},
class: "text-hide",
},
value || "-",
);
},
isHide({ formModel }) {
const goodsType = getUpgradeGoods(formModel)?.goodsInfo?.goodsType;
// 不是太阳膜类型的 隐藏
return !(isSolarFilm(goodsType));
},
},
// 套餐加载时不显示 // 套餐加载时不显示
{ {
name: "settlementType", name: "settlementType",
...@@ -151,19 +174,6 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -151,19 +174,6 @@ export async function getProductDetailDescriptionSchema(shelfType) {
); );
}, },
}, },
// 套餐加载时不显示
// {
// name: "salesProportionPercent",
// label: "销售占比",
// col: 12,
// render(h, { data, schemaItem }) {
// const value = isZeroOrNumber(get(data, schemaItem.name));
// return h(
// "span",
// value === "-" ? value : `${value}%`,
// );
// },
// },
{ {
name: "detailList.0.sellPrice", name: "detailList.0.sellPrice",
label: "售价/件", label: "售价/件",
...@@ -628,16 +638,16 @@ export async function getPackagesDetailDescriptionSchema(shelfType) { ...@@ -628,16 +638,16 @@ export async function getPackagesDetailDescriptionSchema(shelfType) {
label: "原上架ID", label: "原上架ID",
col: 12, col: 12,
render(h, { data, schemaItem }) { render(h, { data, schemaItem }) {
// const value = get(data, schemaItem.name); const value = get(data, schemaItem.name);
// const item = value && shelfStyleOptions.find(item => item.value === value); // const item = value && shelfStyleOptions.find(item => item.value === value);
return h( return h(
"span", "span",
"动态获取" || "-", value || "-",
); );
}, },
isHide({ formModel }) { isHide({ formModel }) {
// 单店模式 且 shelfStyle === 修改才存在 // 单店模式 且 shelfStyle === 修改才存在
return !(isSingleShopMode(shelfType) && !isShelfStyleEdit(formModel.shelfStyle)); return !(isSingleShopMode(shelfType) && isShelfStyleEdit(formModel.shelfStyle));
}, },
}, },
{ {
......
...@@ -140,36 +140,91 @@ export async function getShelfProductImportSchema() { ...@@ -140,36 +140,91 @@ export async function getShelfProductImportSchema() {
col: 24, col: 24,
render(h, { data }) { render(h, { data }) {
const fileName = last(data?.goodsCreateExcel?.split("/")); const fileName = last(data?.goodsCreateExcel?.split("/"));
// 利润率测算表
const onShelvesExcel = last(data?.onShelvesExcel?.split("/"));
return h( return h(
"div", "div",
{ {
attrs: {
title: fileName,
},
style: { style: {
display: "flex", "display": "flex",
"flex-direction": "column",
"align-items": "flex-start",
}, },
}, },
[ [
// 商品上架表
h( h(
"span", "div",
{ {
class: "text-hide", attrs: {
title: fileName,
},
style: { style: {
"max-width": "400px", "display": "flex",
"display": "inline-block", "align-items": "center",
}, },
}, },
fileName, [
), h(
h( "span",
"el-link", {
{ class: "text-hide",
props: { type: "text", href: data?.goodsCreateExcel, target: "_blank" }, style: {
style: { "marginLeft": "8px", "line-height": 1 }, "max-width": "400px",
}, "display": "inline-block",
"下载", },
},
fileName,
),
h(
"el-link",
{
props: { type: "text", href: data?.goodsCreateExcel, target: "_blank" },
style: { "marginLeft": "8px", "line-height": 1 },
},
"下载",
),
],
), ),
// 利润率测算表
onShelvesExcel
? h(
"div",
{
attrs: {
title: onShelvesExcel,
},
style: {
"display": "flex",
"align-items": "center",
"margin-top": "4px",
},
},
[
h(
"span",
{
class: "text-hide",
style: {
"max-width": "400px",
"display": "inline-block",
},
},
onShelvesExcel,
),
h(
"el-link",
{
props: { type: "text", href: data?.onShelvesExcel, target: "_blank" },
style: { "marginLeft": "8px", "line-height": 1 },
},
"下载",
),
],
)
: null,
], ],
); );
}, },
......
...@@ -15,6 +15,12 @@ export const sceneTypeOptions = [ ...@@ -15,6 +15,12 @@ export const sceneTypeOptions = [
{ value: "110202", label: "2.3.2 售后延保" }, { value: "110202", label: "2.3.2 售后延保" },
]; ];
// 商品上架 商品成本带入方式
export const productCostStyleOpt = [
{ value: 2, label: "默认带入产品成本" },
{ value: 1, label: "自定义成本" },
];
export const VIEW_MODE = { export const VIEW_MODE = {
EDIT: "edit", EDIT: "edit",
VIEW: "view", VIEW: "view",
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
style="margin-top:20px"> style="margin-top:20px">
<ShelfProductConfirm :base-scene-code="baseSceneCode" <ShelfProductConfirm :base-scene-code="baseSceneCode"
:business-code="businessCode" :business-code="businessCode"
:merchant-id="merchantIdList"
:shelf-type="shelfType" :shelf-type="shelfType"
:use-edit="false" /> :use-edit="false" />
</FormStep> </FormStep>
...@@ -118,12 +119,14 @@ export default { ...@@ -118,12 +119,14 @@ export default {
baseSceneCode: undefined, baseSceneCode: undefined,
businessCode: undefined, businessCode: undefined,
shelfType: undefined, shelfType: undefined,
merchantIdList: undefined,
logList: [], logList: [],
}; };
}, },
computed: { computed: {
isReadyForNextStep() { isReadyForNextStep() {
return this.baseSceneCode && this.businessCode && this.shelfType; return this.baseSceneCode && this.businessCode && this.shelfType && this.merchantIdList;
}, },
}, },
async created() { async created() {
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<FormStep v-loading="data.isStepLoading" name="ProductConfirm"> <FormStep v-loading="data.isStepLoading" name="ProductConfirm">
<ShelfProductConfirm :base-scene-code="baseSceneCode" <ShelfProductConfirm :base-scene-code="baseSceneCode"
:business-code="businessCode" :business-code="businessCode"
:merchant-id="merchantId"
:shelf-type="shelfType" /> :shelf-type="shelfType" />
</FormStep> </FormStep>
<FormStep v-loading="data.isStepLoading" name="ProfitSharingConfig"> <FormStep v-loading="data.isStepLoading" name="ProfitSharingConfig">
...@@ -222,9 +223,10 @@ export default { ...@@ -222,9 +223,10 @@ export default {
}); });
}, },
async getStep() { async getStep() {
const { confirmStep } = await getShelfProductUpdateStep({ const { confirmStep, merchantId } = await getShelfProductUpdateStep({
businessCode: this.businessCode, businessCode: this.businessCode,
}); });
this.merchantId = merchantId;
return confirmStep - 1; return confirmStep - 1;
}, },
async beforeChangeStepBefore(isNext) { async beforeChangeStepBefore(isNext) {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
style="margin-top:20px"> style="margin-top:20px">
<ShelfProductConfirm :base-scene-code="baseSceneCode" <ShelfProductConfirm :base-scene-code="baseSceneCode"
:business-code="businessCode" :business-code="businessCode"
:merchant-id="merchantId" :merchant-id="merchantIdList"
:shelf-type="shelfType" :shelf-type="shelfType"
:use-edit="false" /> :use-edit="false" />
</FormStep> </FormStep>
...@@ -82,13 +82,13 @@ export default { ...@@ -82,13 +82,13 @@ export default {
baseSceneCode: undefined, baseSceneCode: undefined,
businessCode: undefined, businessCode: undefined,
shelfType: undefined, shelfType: undefined,
merchantId: undefined, merchantIdList: undefined,
logList: [], logList: [],
}; };
}, },
computed: { computed: {
isReadyForNextStep() { isReadyForNextStep() {
return this.baseSceneCode && this.businessCode && this.shelfType; return this.baseSceneCode && this.businessCode && this.shelfType && this.merchantIdList;
}, },
}, },
async created() { async created() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!