Commit 5868d21c by Jaxon

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

1 parent 3a496b55
......@@ -724,6 +724,11 @@ export const routerName = {
parentId: "9031803",
name: "商品查看",
},
{
authId: "90318102",
parentId: "9031803",
name: "常规商品详情",
},
],
},
{
......@@ -737,6 +742,11 @@ export const routerName = {
name: "商品编辑",
parentId: "90318",
},
{
authId: "90318101",
parentId: "9031803",
name: "常规上架",
},
],
},
{
......@@ -766,6 +776,19 @@ export const routerName = {
},
component: _import("goods/shelfProduct/view/normalModify/index"),
},
// 常规商品详情
90318102: {
path: "/goods-shelf/normal-detail",
name: "goodsShelfNormalDetail",
meta: {
title: "常规上架详情",
authId: "90318102",
parentId: "90318",
sideHidden: true,
activePath: "/goods-shelf",
},
component: _import("goods/shelfProduct/view/normalDetail/index"),
},
9031802: {
path: "/goods-shelf/modify",
......@@ -779,6 +802,7 @@ export const routerName = {
},
component: _import("goods/shelfProduct/view/modify/index"),
},
// 特殊商品详情
9031805: {
path: "/goods-shelf/detail",
name: "goodsShelfDetail",
......
......@@ -189,12 +189,18 @@ export function postReconciliationConfigOtherGoodsApi(data = {}) {
return request(data, RequestMethods.POST);
}
// 获取 product 的 原上架id用的列表
// 获取 product 的 原上架id用的列表 - 商品
export function postProductOldMerchantGoodsCodeList(data = {}) {
data.method = "dj.api.marketing.goods.page";
return request(data, RequestMethods.POST);
}
// 获取 product 的 原上架id用的列表 - 套餐
export function postComboOldMerchantGoodsCodeList(data = {}) {
data.method = "dj.api.marketing.package.page";
return request(data, RequestMethods.POST);
}
// 获取 服务项目
export function postProductServiceList(data = {}) {
// 只要膜类
......
......@@ -3,8 +3,10 @@
<div v-if="form.groupType !== 1" style="display: flex">
<el-form-item label="分账品类"
prop="specialDetail.categoryType">
<!-- 5.8.4 禁止修改 -->
<el-select v-model="form.categoryType"
style="width:414px"
disabled
@change="handleCategoryTypeChange">
<el-option v-for="item in options.categoryType"
:key="item.value"
......@@ -17,12 +19,14 @@
label-width="12px"
prop="specialDetail.goodsTypeGroupRelationList"
required>
<!-- 5.8.4 禁止修改 -->
<RemoteSelect v-if="form.categoryType === 2"
:key="form.categoryType"
v-model="form.goodsTypeGroupRelationList"
placeholder="请选择商品"
style="width:390px"
value-key="merchantGoodsCode"
disabled
:fetch-api="fetchUpgradeGoodsList"
:field-name="{
value: 'merchantGoodsCode',
......@@ -37,6 +41,7 @@
}"
:options.sync="options.upgradeGoods">
</RemoteSelect>
<!-- 5.8.4 禁止修改 -->
<RemoteSelect v-if="form.categoryType === 3"
:key="form.categoryType"
ref="packageGoods"
......@@ -44,6 +49,7 @@
placeholder="请选择套餐"
style="width:390px"
value-key="packageCode"
disabled
:fetch-api="getPackagesGoodsList"
:field-name="{
value: 'packageCode',
......
......@@ -135,23 +135,24 @@
<span class="label">
{{ item.title }}
</span>
<span v-if="(item.groupType !== 1) && useEdit && isView(editState)"
<!-- 5.8.4 取消删除 -->
<!-- <span v-if="(item.groupType !== 1) && useEdit && isView(editState)"
class="actions el-icon-close"
@click.stop="handleRemoveTitleSelectItem(item)">
</span>
</span> -->
</div>
</el-option>
</el-select>
</div>
<span v-if="useEdit && editState === VIEW_MODE.VIEW" class="actions-wrapper">
<!-- 5.8.4 取消新增 -->
<!-- <span v-if="useEdit && editState === VIEW_MODE.VIEW" class="actions-wrapper">
<el-button icon="el-icon-plus"
size="small"
plain
@click="handleAppendSpecialCategory">
新增
</el-button>
</span>
</span> -->
</div>
<div v-if="tabsActive" class="public-container">
......
......@@ -3,8 +3,10 @@
<div v-if="form.groupType !== 1" style="display: flex">
<el-form-item label="分账品类"
prop="specialDetail.categoryType">
<!-- 5.8.4 禁止修改 -->
<el-select v-model="form.categoryType"
style="width:414px"
disabled
@change="handleCategoryTypeChange">
<el-option v-for="item in options.categoryType"
:key="item.value"
......@@ -18,13 +20,14 @@
label-width="12px"
prop="specialDetail.goodsTypeGroupRelationList"
required>
<!-- 5.8.4 取消修改 -->
<RemoteSelect v-if="form.categoryType === 2"
:key="form.categoryType"
v-model="form.goodsTypeGroupRelationList"
placeholder="请选择商品"
style="width:390px"
value-key="merchantGoodsCode"
disabled
:fetch-api="fetchUpgradeGoodsList"
:field-name="{
value: 'merchantGoodsCode',
......@@ -39,6 +42,7 @@
}"
:options.sync="options.upgradeGoods">
</RemoteSelect>
<!-- 5.8.4 取消修改 -->
<RemoteSelect v-if="form.categoryType === 3"
:key="form.categoryType"
ref="packageGoods"
......@@ -46,6 +50,7 @@
placeholder="请选择套餐商品"
style="width:390px"
value-key="packageCode"
disabled
:fetch-api="fetchPackagesGoodsList"
:field-name="{
value: 'packageCode',
......
......@@ -102,23 +102,26 @@
<span class="label">
{{ item.title }}
</span>
<span v-if="useEdit && isView(editState) && item.groupType !== 1"
<!-- 5.8.4 取消删除功能 -->
<!-- <span v-if="useEdit && isView(editState) && item.groupType !== 1"
class="actions el-icon-close"
@click.stop="handleRemoveTitleSelectItem(item)">
</span>
</span> -->
</div>
</el-option>
</el-select>
</div>
<span v-if="useEdit && isView(editState)" class="actions-wrapper">
<!-- 5.8.4 取消删除新增 -->
<!-- <span v-if="useEdit && isView(editState)" class="actions-wrapper">
<el-button icon="el-icon-plus"
size="small"
plain
@click="handleAppendSpecialCategory">
新增
</el-button>
</span>
</span> -->
</div>
<div v-if="tabsActive" class="public-container">
......@@ -232,6 +235,8 @@ export default {
form: {
firstLineSunshineOnlinePointsFlag: "N",
firstLineSunshine2OnlinePointsFlag: "N",
managementMarketingFeesPrerequisite: "N",
firstLineSunshinePrerequisite: "N",
operationMode: undefined,
specialDetail: {
categoryType: undefined,
......@@ -241,17 +246,20 @@ export default {
},
},
rules: {
// 一线阳光是否开启线上积分
"firstLineSunshineOnlinePointsFlag": [
{ required: true, trigger: "change" },
{ required: true, message: "请选择一线阳光是否开启线上积分", trigger: "change" },
],
"firstLineSunshine2OnlinePointsFlag": [
{ required: true, trigger: "change" },
{ required: true, message: "请选择一线阳光2是否开启线上积分", trigger: "change" },
],
// 管理层市场费是否前置
"managementMarketingFeesPrerequisite": [
{ required: true, trigger: "change" },
{ required: true, message: "请选择管理层市场费是否前置", trigger: "change" },
],
// 请选择一线阳光是否前置
"firstLineSunshinePrerequisite": [
{ required: true, trigger: "change" },
{ required: true, message: "请选择一线阳光是否前置", trigger: "change" },
],
"specialDetail.categoryType": [
{ required: true, message: "请选择分账品类", trigger: "change" },
......
......@@ -39,20 +39,23 @@
</el-radio-group>
</el-form-item>
</el-col>
<!-- TODO: 且上架类型的值 为 修改 才显示 -->
<!-- 单店模式 且 类型 为修改 -->
<el-col v-if="isSingleShopMode(shelfType) && isShelfStyleEdit(packageForm.shelfStyle)" :span="12">
<el-form-item label="原上架ID:"
prop="oldMerchantGoodsCode"
:rules="[{ required: true, message: '请选择原上架ID', trigger: 'change' }]">
<el-select v-model="packageForm.oldMerchantGoodsCode"
placeholder="请选择">
<el-option v-for="item in options.serviceList"
:key="item.id"
:label="item.serviceItemsName"
:value="item.id">
</el-option>
</el-select>
<RemoteSelect v-model="packageForm.oldMerchantGoodsCode"
placeholder="原上架ID"
:fetch-api="fetchMerchantGoodsCode"
:field-name="{
value: 'goodsCode',
label: 'productName',
}"
:immediate="true"
:multiple="false"
:options.sync="options.oldMerchantGoodsCode">
</RemoteSelect>
</el-form-item>
</el-col>
......@@ -68,20 +71,6 @@
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="销售占比:" prop="salesProportionPercent">
<div class="form-item-append-fix">
<VenusNumberInput v-model="packageForm.salesProportionPercent"
placeholder="请输入销售占比"
:controls="false"
:max="100"
:min="0"
:precision="2">
</VenusNumberInput>
<span class="fix-symbol">%</span>
</div>
</el-form-item>
</el-col> -->
<el-col title="按子商品的售价进行累计,实时计算" :span="12">
<el-form-item label="售价/件:" prop="sellPrice">
......@@ -180,6 +169,7 @@
:base-scene-code="baseSceneCode"
:disabled-positions="getProductDisabledPositions(goodsForm.upgradeGoodsId, goodsForm.merchantGoodsCode)"
:edit-state="VIEW_MODE.EDIT"
:merchant-id="merchantId"
:merchant-id-list="merchantIdList"
:product.sync="goodsForm"
:shelf-type="shelfType"
......@@ -204,6 +194,7 @@ import { nanoid } from "nanoid";
import { settlementTypeOpt } from "@/common/constants.js";
import VenusNumberInput from "@/components/venusNumberInput/index.vue";
import { baseConfig } from "@/main";
import { postComboOldMerchantGoodsCodeList } from "@/views/goods/shelfProduct/api";
import { shelfStyleOptions, VIEW_MODE } from "@/views/goods/shelfProduct/constant/index";
import { isMemberRightsUpgrade, isQualityUpgrade, isShelfStyleEdit, isSingleShopMode, isSolarFilm, isUpgradeProductCostStyleCustom, isUpgradeProductCostStyleDefault } from "@/views/goods/shelfProduct/utils/status.js";
import Product from "../../../product/index.vue";
......@@ -219,6 +210,10 @@ export default {
type: Array,
required: true,
},
merchantId: {
type: Number,
required: true,
},
baseSceneCode: {
type: String,
required: true,
......@@ -241,6 +236,7 @@ export default {
options: {
settlementType: settlementTypeOpt,
shelfStyleOptions,
oldMerchantGoodsCode: [],
},
dialog: {
selectGoods: {
......@@ -308,6 +304,21 @@ export default {
isQualityUpgrade,
isSolarFilm,
isSingleShopMode,
async fetchMerchantGoodsCode({ pageQuery }) {
const res = await postComboOldMerchantGoodsCodeList({
...pageQuery,
merchantIds: [this.merchantId],
baseSceneCode: this.baseSceneCode,
productName: pageQuery.searchValue,
});
return {
list: res.list,
query: {
pages: res.pages,
total: res.total,
},
};
},
getProductDisabledPositions(upgradeGoodsId, excludeMerchantGoodsCode) {
return this.productList.filter(item => item.upgradeGoodsId === upgradeGoodsId && item.merchantGoodsCode !== excludeMerchantGoodsCode).map(item => item.detailList?.[0]?.position);
},
......@@ -324,7 +335,6 @@ export default {
upgradeCommodityCode: upgradeGoods.commodityCode,
upgradeGoodsId: upgradeGoods.id,
upgradeGoodsName: upgradeGoods.upgradeGoodsName,
});
}
},
......
......@@ -189,7 +189,6 @@
</el-form-item>
</el-col>
<!-- TODO: 为空默认为0 , 这里需要前端修改还是后端直接改为0 ? -->
<el-col v-if="isMemberRightsUpgrade(baseSceneCode)" :span="12">
<el-form-item label="嘀加成本/件:"
prop="djCost">
......@@ -235,22 +234,6 @@
</el-form-item>
</el-col>
<!-- <el-col v-if="isQualityUpgrade(baseSceneCode)" :span="12">
<el-form-item label="回收成本:"
prop="detailList[0].recoveryCost">
<div class="form-item-append-fix">
<VenusNumberInput v-model="product.detailList[0].recoveryCost"
placeholder="请输入回收成本"
:controls="false"
:max="999999"
:min="0"
:precision="2">
</VenusNumberInput>
<span class="fix-symbol">元</span>
</div>
</el-form-item>
</el-col> -->
<!-- ●赠送成本(仅精品升级场景存在) -->
<!-- TODO 5.8.6 ○若否则默认为空 -->
<!-- TODO 5.8.6 ○若是则自动带入对应的产品、升级成本,成本的获取方式与产品、升级成本一致; -->
......
<template>
<d2-container v-loading="!isReadyForNextStep" class="detail-wrapper">
<FormProvider v-if="isReadyForNextStep"
class="form-provide-wrapper"
:use-edit="false">
<template #default="{ data }">
<FormStep name="ProductImport">
<ShelfProductImport ref="shelfProductImportRef"
:business-code="businessCode"
:use-edit="false" />
</FormStep>
<FormStep v-loading="data.getSomeItemStepLoading('ProductConfirm')"
name="ProductConfirm"
style="margin-top:20px">
<ShelfProductConfirm :base-scene-code="baseSceneCode"
:business-code="businessCode"
:merchant-id="merchantId"
:shelf-type="shelfType"
:use-edit="false" />
</FormStep>
<!-- 5.8.4 批量模式没有这个 -->
<FormStep v-if="isSingleShopMode(shelfType)"
v-loading="data.getSomeItemStepLoading('ProfitMarginTable')"
name="ProfitMarginTable"
style="height:100%;margin-top:20px">
<ProfitMarginTable style="height:680px;overflow:hidden"
:business-code="businessCode"
:use-edit="false" />
</FormStep>
<FormStep v-loading="data.getSomeItemStepLoading('OperateOperateList')"
name="OperateList"
style="margin-top:20px">
<OperateList :log-list="logList" />
</FormStep>
<div style="text-align:center">
<el-button size="small"
style="width:60px"
type="info"
@click="handleBack">
返回
</el-button>
</div>
</template>
</FormProvider>
</d2-container>
</template>
<script>
import {
getShelfProductBaseInfoApi,
} from "@/views/goods/shelfProduct/api";
import { sceneTypeOptions } from "@/views/goods/shelfProduct/constant/index";
import { getMemberRightsUpgradeValue, isMemberRightsUpgrade, isQualityUpgrade, isSingleShopMode } from "@/views/goods/shelfProduct/utils/status";
import FormStep from "../../components/formProvider/formStep.vue";
import FormProvider from "../../components/formProvider/index.vue";
import OperateList from "../../components/operateList/index.vue";
import ProfitMarginTable from "../../components/profitMarginTable/index.vue";
import ProfitSharingConfig from "../../components/profitSharingConfig/index.vue";
import ReconciliationConfig from "../../components/reconciliationConfig/index.vue";
import ShelfProductConfirm from "../../components/shelfProductConfirm/index.vue";
import ShelfProductImport from "../../components/shelfProductImport/index.vue";
export default {
name: "",
components: {
OperateList,
ShelfProductImport,
ShelfProductConfirm,
ProfitMarginTable,
FormProvider,
FormStep,
},
props: {
},
data() {
return {
sceneTypeOptions,
baseSceneCode: undefined,
businessCode: undefined,
shelfType: undefined,
merchantId: undefined,
logList: [],
};
},
computed: {
isReadyForNextStep() {
return this.baseSceneCode && this.businessCode && this.shelfType;
},
},
async created() {
this.baseSceneCode = this.$route.query.baseSceneCode;
this.businessCode = this.$route.query.businessCode;
this.shelfType = Number(this.$route.query.shelfType);
await this.$nextTick();
await this.getStep(this.businessCode);
},
mounted() {
},
methods: {
isSingleShopMode,
getMemberRightsUpgradeValue,
isMemberRightsUpgrade,
isQualityUpgrade,
async getStep(businessCode) {
const res = await getShelfProductBaseInfoApi({ businessCode });
if (!res.logList) {
res.logList = [];
}
Object.assign(this.$data, res);
},
handleBack() {
this.$router.back();
},
},
};
</script>
<style scoped lang="scss">
.detail-wrapper {
}
</style>
......@@ -47,7 +47,7 @@
:merchant-id="merchantId"
:shelf-type="shelfType" />
</FormStep>
<FormStep v-loading="data.isStepLeoading"
<FormStep v-loading="data.isStepLoading"
name="ProfitMarginTable"
style="height:100%">
<ProfitMarginTable :business-code="businessCode" />
......@@ -63,7 +63,7 @@
@click="handlePreviousSteps">
上一步
</VenusButton>
<VenusButton v-if="step.confirmStep < 2"
<VenusButton v-if="step.confirmStep < (isSingleShopMode(shelfType) ? 2 : 1)"
size="small"
type="primary"
:disabled="data.isEditing || data.isSaving"
......
......@@ -25,11 +25,11 @@
<span style=" display:flex; gap:8px; ">
<!-- 常规上架 handleNormalModify -->
<auth-button category="Button"
:data="{ operate: 'create' }"
:data="{ operate: 'create', record: { shelfModel: 2 } }"
:show-btn-ids="['9031810']" />
<!-- 特殊商品上架 handleModify -->
<auth-button category="Button"
:data="{ operate: 'create' }"
:data="{ operate: 'create', record: { shelfModel: 1 } }"
:show-btn-ids="['9031801']" />
</span>
</d2-table-header>
......@@ -189,21 +189,36 @@ export default {
},
// 查看
handleDetail(row) {
this.$router.push({
name: "goodsShelfDetail",
query: {
baseSceneCode: row.baseSceneCode,
businessCode: row.businessCode,
shelfType: row.shelfType,
},
});
if (row.shelfModel === 1) {
// 特殊上架详情
this.$router.push({
name: "goodsShelfDetail",
query: {
baseSceneCode: row.baseSceneCode,
businessCode: row.businessCode,
shelfType: row.shelfType,
},
});
}
if (row.shelfModel === 2) {
// 常规上架详情
this.$router.push({
name: "goodsShelfNormalDetail",
query: {
baseSceneCode: row.baseSceneCode,
businessCode: row.businessCode,
shelfType: row.shelfType,
shelfModel: row.shelfModel,
},
});
}
},
// 新增 或 修改
handleModify({ operate, record }) {
console.log(record);
// 特殊上架编辑
if (record.shelfModel === 1) {
if (record?.shelfModel === 1) {
if (operate === "create") {
this.$router.push({
name: "goodsShelfCreate",
......@@ -222,7 +237,7 @@ export default {
}
}
if (record.shelfModel === 2) {
if (record?.shelfModel === 2) {
if (operate === "create") {
this.$router.push({
name: "goodsShelfNormalModify",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!