Commit 8b283b40 by Jaxon

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

Feature/584/jaxon

See merge request !868
2 parents b2868a94 9b0352c6
Showing 24 changed files with 609 additions and 203 deletions
...@@ -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,7 +235,7 @@ export default { ...@@ -236,7 +235,7 @@ export default {
}); });
} }
}, },
handleSelectChange(e) { handleSelectChange(e, d) {
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);
......
...@@ -9,13 +9,13 @@ import store from "@/store"; ...@@ -9,13 +9,13 @@ import store from "@/store";
axios.defaults.withCredentials = true; axios.defaults.withCredentials = true;
// const expiresMinute = 60 // 过期时间(分钟) // const expiresMinute = 60 // 过期时间(分钟)
// 创建一个错误 // 创建一个错误
export function errorCreate (msg) { export function errorCreate(msg) {
const error = new Error(msg); const error = new Error(msg);
errorLog(error); errorLog(error);
throw error; throw error;
} }
// 记录和显示错误 // 记录和显示错误
function errorLog (error) { function errorLog(error) {
console.log("error", error.toString(), error); console.log("error", error.toString(), error);
// 添加到日志 // 添加到日志
store.dispatch("d2admin/log/push", { store.dispatch("d2admin/log/push", {
...@@ -148,7 +148,9 @@ service.interceptors.response.use( ...@@ -148,7 +148,9 @@ service.interceptors.response.use(
return errorCreate("登录超时,请重新登录"); return errorCreate("登录超时,请重新登录");
// return Promise.reject(new Error(response.message || 'Error')) // return Promise.reject(new Error(response.message || 'Error'))
} }
if (returnAll) return dataAxios; if (returnAll) {
return dataAxios;
}
const codeValue = dataAxios[ruleResult.code_key] || dataAxios.returnCode; const codeValue = dataAxios[ruleResult.code_key] || dataAxios.returnCode;
switch (+codeValue) { switch (+codeValue) {
case ruleResult.code_success_value: case ruleResult.code_success_value:
...@@ -224,8 +226,9 @@ service.interceptors.response.use( ...@@ -224,8 +226,9 @@ service.interceptors.response.use(
if (!error.config?.skipGlobalLoading) { if (!error.config?.skipGlobalLoading) {
store.commit("d2admin/loading/set", false); store.commit("d2admin/loading/set", false);
} }
if (!error.__CANCEL__) if (!error.__CANCEL__) {
errorLog(error); // 取消请求 不做错误提示 errorLog(error);
} // 取消请求 不做错误提示
return Promise.reject(error); return Promise.reject(error);
}, },
); );
......
...@@ -748,6 +748,11 @@ export const routerName = { ...@@ -748,6 +748,11 @@ export const routerName = {
parentId: "9031803", parentId: "9031803",
name: "商品查看", name: "商品查看",
}, },
{
authId: "90318102",
parentId: "9031803",
name: "常规商品详情",
},
], ],
}, },
{ {
...@@ -761,6 +766,11 @@ export const routerName = { ...@@ -761,6 +766,11 @@ export const routerName = {
name: "商品编辑", name: "商品编辑",
parentId: "90318", parentId: "90318",
}, },
{
authId: "90318101",
parentId: "9031803",
name: "常规上架",
},
], ],
}, },
{ {
...@@ -780,7 +790,7 @@ export const routerName = { ...@@ -780,7 +790,7 @@ export const routerName = {
90318101: { 90318101: {
path: "/goods-shelf/normal-modify", path: "/goods-shelf/normal-modify",
name: "goodsShelfNormalCreate", name: "goodsShelfNormalModify",
meta: { meta: {
title: "常规上架", title: "常规上架",
authId: "90318101", authId: "90318101",
...@@ -790,6 +800,19 @@ export const routerName = { ...@@ -790,6 +800,19 @@ export const routerName = {
}, },
component: _import("goods/shelfProduct/view/normalModify/index"), 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: { 9031802: {
path: "/goods-shelf/modify", path: "/goods-shelf/modify",
...@@ -803,6 +826,7 @@ export const routerName = { ...@@ -803,6 +826,7 @@ export const routerName = {
}, },
component: _import("goods/shelfProduct/view/modify/index"), component: _import("goods/shelfProduct/view/modify/index"),
}, },
// 特殊商品详情
9031805: { 9031805: {
path: "/goods-shelf/detail", path: "/goods-shelf/detail",
name: "goodsShelfDetail", name: "goodsShelfDetail",
......
...@@ -189,15 +189,27 @@ export function postReconciliationConfigOtherGoodsApi(data = {}) { ...@@ -189,15 +189,27 @@ export function postReconciliationConfigOtherGoodsApi(data = {}) {
return request(data, RequestMethods.POST); return request(data, RequestMethods.POST);
} }
// 获取 product 的 原上架id用的列表 // 获取 product 的 原上架id用的列表 - 商品
export function postProductOldMerchantGoodsCodeList(data = {}) { export function postProductOldMerchantGoodsCodeList(data = {}) {
data.method = "dj.api.marketing.goods.page"; data.method = "dj.api.marketing.goods.page";
return request(data, RequestMethods.POST); 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 = {}) { 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);
}
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
<div v-if="form.groupType !== 1" style="display: flex"> <div v-if="form.groupType !== 1" style="display: flex">
<el-form-item label="分账品类" <el-form-item label="分账品类"
prop="specialDetail.categoryType"> prop="specialDetail.categoryType">
<!-- 5.8.4 禁止修改 -->
<el-select v-model="form.categoryType" <el-select v-model="form.categoryType"
style="width:414px" style="width:414px"
disabled
@change="handleCategoryTypeChange"> @change="handleCategoryTypeChange">
<el-option v-for="item in options.categoryType" <el-option v-for="item in options.categoryType"
:key="item.value" :key="item.value"
...@@ -17,12 +19,14 @@ ...@@ -17,12 +19,14 @@
label-width="12px" label-width="12px"
prop="specialDetail.goodsTypeGroupRelationList" prop="specialDetail.goodsTypeGroupRelationList"
required> required>
<!-- 5.8.4 禁止修改 -->
<RemoteSelect v-if="form.categoryType === 2" <RemoteSelect v-if="form.categoryType === 2"
:key="form.categoryType" :key="form.categoryType"
v-model="form.goodsTypeGroupRelationList" v-model="form.goodsTypeGroupRelationList"
placeholder="请选择商品" placeholder="请选择商品"
style="width:390px" style="width:390px"
value-key="merchantGoodsCode" value-key="merchantGoodsCode"
disabled
:fetch-api="fetchUpgradeGoodsList" :fetch-api="fetchUpgradeGoodsList"
:field-name="{ :field-name="{
value: 'merchantGoodsCode', value: 'merchantGoodsCode',
...@@ -37,6 +41,7 @@ ...@@ -37,6 +41,7 @@
}" }"
:options.sync="options.upgradeGoods"> :options.sync="options.upgradeGoods">
</RemoteSelect> </RemoteSelect>
<!-- 5.8.4 禁止修改 -->
<RemoteSelect v-if="form.categoryType === 3" <RemoteSelect v-if="form.categoryType === 3"
:key="form.categoryType" :key="form.categoryType"
ref="packageGoods" ref="packageGoods"
...@@ -44,6 +49,7 @@ ...@@ -44,6 +49,7 @@
placeholder="请选择套餐" placeholder="请选择套餐"
style="width:390px" style="width:390px"
value-key="packageCode" value-key="packageCode"
disabled
:fetch-api="getPackagesGoodsList" :fetch-api="getPackagesGoodsList"
:field-name="{ :field-name="{
value: 'packageCode', value: 'packageCode',
......
...@@ -135,23 +135,24 @@ ...@@ -135,23 +135,24 @@
<span class="label"> <span class="label">
{{ item.title }} {{ item.title }}
</span> </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" class="actions el-icon-close"
@click.stop="handleRemoveTitleSelectItem(item)"> @click.stop="handleRemoveTitleSelectItem(item)">
</span> </span> -->
</div> </div>
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<!-- 5.8.4 取消新增 -->
<span v-if="useEdit && editState === VIEW_MODE.VIEW" class="actions-wrapper"> <!-- <span v-if="useEdit && editState === VIEW_MODE.VIEW" class="actions-wrapper">
<el-button icon="el-icon-plus" <el-button icon="el-icon-plus"
size="small" size="small"
plain plain
@click="handleAppendSpecialCategory"> @click="handleAppendSpecialCategory">
新增 新增
</el-button> </el-button>
</span> </span> -->
</div> </div>
<div v-if="tabsActive" class="public-container"> <div v-if="tabsActive" class="public-container">
......
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
<div v-if="form.groupType !== 1" style="display: flex"> <div v-if="form.groupType !== 1" style="display: flex">
<el-form-item label="分账品类" <el-form-item label="分账品类"
prop="specialDetail.categoryType"> prop="specialDetail.categoryType">
<!-- 5.8.4 禁止修改 -->
<el-select v-model="form.categoryType" <el-select v-model="form.categoryType"
style="width:414px" style="width:414px"
disabled
@change="handleCategoryTypeChange"> @change="handleCategoryTypeChange">
<el-option v-for="item in options.categoryType" <el-option v-for="item in options.categoryType"
:key="item.value" :key="item.value"
...@@ -18,13 +20,14 @@ ...@@ -18,13 +20,14 @@
label-width="12px" label-width="12px"
prop="specialDetail.goodsTypeGroupRelationList" prop="specialDetail.goodsTypeGroupRelationList"
required> required>
<!-- 5.8.4 取消修改 -->
<RemoteSelect v-if="form.categoryType === 2" <RemoteSelect v-if="form.categoryType === 2"
:key="form.categoryType" :key="form.categoryType"
v-model="form.goodsTypeGroupRelationList" v-model="form.goodsTypeGroupRelationList"
placeholder="请选择商品" placeholder="请选择商品"
style="width:390px" style="width:390px"
value-key="merchantGoodsCode" value-key="merchantGoodsCode"
disabled
:fetch-api="fetchUpgradeGoodsList" :fetch-api="fetchUpgradeGoodsList"
:field-name="{ :field-name="{
value: 'merchantGoodsCode', value: 'merchantGoodsCode',
...@@ -39,6 +42,7 @@ ...@@ -39,6 +42,7 @@
}" }"
:options.sync="options.upgradeGoods"> :options.sync="options.upgradeGoods">
</RemoteSelect> </RemoteSelect>
<!-- 5.8.4 取消修改 -->
<RemoteSelect v-if="form.categoryType === 3" <RemoteSelect v-if="form.categoryType === 3"
:key="form.categoryType" :key="form.categoryType"
ref="packageGoods" ref="packageGoods"
...@@ -46,6 +50,7 @@ ...@@ -46,6 +50,7 @@
placeholder="请选择套餐商品" placeholder="请选择套餐商品"
style="width:390px" style="width:390px"
value-key="packageCode" value-key="packageCode"
disabled
:fetch-api="fetchPackagesGoodsList" :fetch-api="fetchPackagesGoodsList"
:field-name="{ :field-name="{
value: 'packageCode', value: 'packageCode',
......
...@@ -102,23 +102,26 @@ ...@@ -102,23 +102,26 @@
<span class="label"> <span class="label">
{{ item.title }} {{ item.title }}
</span> </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" class="actions el-icon-close"
@click.stop="handleRemoveTitleSelectItem(item)"> @click.stop="handleRemoveTitleSelectItem(item)">
</span> </span> -->
</div> </div>
</el-option> </el-option>
</el-select> </el-select>
</div> </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" <el-button icon="el-icon-plus"
size="small" size="small"
plain plain
@click="handleAppendSpecialCategory"> @click="handleAppendSpecialCategory">
新增 新增
</el-button> </el-button>
</span> </span> -->
</div> </div>
<div v-if="tabsActive" class="public-container"> <div v-if="tabsActive" class="public-container">
...@@ -232,6 +235,8 @@ export default { ...@@ -232,6 +235,8 @@ export default {
form: { form: {
firstLineSunshineOnlinePointsFlag: "N", firstLineSunshineOnlinePointsFlag: "N",
firstLineSunshine2OnlinePointsFlag: "N", firstLineSunshine2OnlinePointsFlag: "N",
managementMarketingFeesPrerequisite: "N",
firstLineSunshinePrerequisite: "N",
operationMode: undefined, operationMode: undefined,
specialDetail: { specialDetail: {
categoryType: undefined, categoryType: undefined,
...@@ -241,17 +246,20 @@ export default { ...@@ -241,17 +246,20 @@ export default {
}, },
}, },
rules: { rules: {
// 一线阳光是否开启线上积分
"firstLineSunshineOnlinePointsFlag": [ "firstLineSunshineOnlinePointsFlag": [
{ required: true, trigger: "change" }, { required: true, message: "请选择一线阳光是否开启线上积分", trigger: "change" },
], ],
"firstLineSunshine2OnlinePointsFlag": [ "firstLineSunshine2OnlinePointsFlag": [
{ required: true, trigger: "change" }, { required: true, message: "请选择一线阳光2是否开启线上积分", trigger: "change" },
], ],
// 管理层市场费是否前置
"managementMarketingFeesPrerequisite": [ "managementMarketingFeesPrerequisite": [
{ required: true, trigger: "change" }, { required: true, message: "请选择管理层市场费是否前置", trigger: "change" },
], ],
// 请选择一线阳光是否前置
"firstLineSunshinePrerequisite": [ "firstLineSunshinePrerequisite": [
{ required: true, trigger: "change" }, { required: true, message: "请选择一线阳光是否前置", trigger: "change" },
], ],
"specialDetail.categoryType": [ "specialDetail.categoryType": [
{ required: true, message: "请选择分账品类", trigger: "change" }, { required: true, message: "请选择分账品类", trigger: "change" },
......
...@@ -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>
......
...@@ -39,20 +39,23 @@ ...@@ -39,20 +39,23 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- TODO: 且上架类型的值 为 修改 才显示 --> <!-- 单店模式 且 类型 为修改 -->
<el-col v-if="isSingleShopMode(shelfType) && isShelfStyleEdit(packageForm.shelfStyle)" :span="12"> <el-col v-if="isSingleShopMode(shelfType) && isShelfStyleEdit(packageForm.shelfStyle)" :span="12">
<el-form-item label="原上架ID:" <el-form-item label="原上架ID:"
prop="oldMerchantGoodsCode" prop="oldMerchantGoodsCode"
:rules="[{ required: true, message: '请选择原上架ID', trigger: 'change' }]"> :rules="[{ required: true, message: '请选择原上架ID', trigger: 'change' }]">
<el-select v-model="packageForm.oldMerchantGoodsCode"
placeholder="请选择"> <RemoteSelect v-model="packageForm.oldMerchantGoodsCode"
<el-option v-for="item in options.serviceList" placeholder="原上架ID"
:key="item.id" :fetch-api="fetchMerchantGoodsCode"
:label="item.serviceItemsName" :field-name="{
:value="item.id"> value: 'packageId',
</el-option> label: 'packageId',
</el-select> }"
:immediate="true"
:multiple="false"
:options.sync="options.oldMerchantGoodsCode">
</RemoteSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -68,20 +71,6 @@ ...@@ -68,20 +71,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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-col title="按子商品的售价进行累计,实时计算" :span="12">
<el-form-item label="售价/件:" prop="sellPrice"> <el-form-item label="售价/件:" prop="sellPrice">
...@@ -146,21 +135,6 @@ ...@@ -146,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>
...@@ -180,6 +154,7 @@ ...@@ -180,6 +154,7 @@
:base-scene-code="baseSceneCode" :base-scene-code="baseSceneCode"
:disabled-positions="getProductDisabledPositions(goodsForm.upgradeGoodsId, goodsForm.merchantGoodsCode)" :disabled-positions="getProductDisabledPositions(goodsForm.upgradeGoodsId, goodsForm.merchantGoodsCode)"
:edit-state="VIEW_MODE.EDIT" :edit-state="VIEW_MODE.EDIT"
:merchant-id="merchantId"
:merchant-id-list="merchantIdList" :merchant-id-list="merchantIdList"
:product.sync="goodsForm" :product.sync="goodsForm"
:shelf-type="shelfType" :shelf-type="shelfType"
...@@ -202,8 +177,10 @@ ...@@ -202,8 +177,10 @@
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 { shelfStyleOptions, VIEW_MODE } from "@/views/goods/shelfProduct/constant/index"; 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 { isMemberRightsUpgrade, isQualityUpgrade, isShelfStyleEdit, isSingleShopMode, isSolarFilm, isUpgradeProductCostStyleCustom, isUpgradeProductCostStyleDefault } from "@/views/goods/shelfProduct/utils/status.js";
import Product from "../../../product/index.vue"; import Product from "../../../product/index.vue";
...@@ -213,12 +190,17 @@ export default { ...@@ -213,12 +190,17 @@ export default {
components: { components: {
Product, Product,
VenusNumberInput, VenusNumberInput,
RemoteSelect,
}, },
props: { props: {
merchantIdList: { merchantIdList: {
type: Array, type: Array,
required: true, required: true,
}, },
merchantId: {
type: [Number, Array],
required: true,
},
baseSceneCode: { baseSceneCode: {
type: String, type: String,
required: true, required: true,
...@@ -241,6 +223,7 @@ export default { ...@@ -241,6 +223,7 @@ export default {
options: { options: {
settlementType: settlementTypeOpt, settlementType: settlementTypeOpt,
shelfStyleOptions, shelfStyleOptions,
oldMerchantGoodsCode: [],
}, },
dialog: { dialog: {
selectGoods: { selectGoods: {
...@@ -272,7 +255,7 @@ export default { ...@@ -272,7 +255,7 @@ export default {
res[2] += (item.upgradeGoods.djCost ?? 0) * 100; res[2] += (item.upgradeGoods.djCost ?? 0) * 100;
res[3] += (item.thirdPartyCost ?? 0) * 100; res[3] += (item.thirdPartyCost ?? 0) * 100;
res[4] += (item.upgradeProductCost ?? 0) * 100; res[4] += (item.upgradeProductCost ?? 0) * 100;
res[5] += (item.recoveryCost ?? 0) * 100; // res[5] += (item.recoveryCost ?? 0) * 100;
return res; return res;
}, [0, 0, 0, 0, 0, 0]); }, [0, 0, 0, 0, 0, 0]);
return { return {
...@@ -281,7 +264,7 @@ export default { ...@@ -281,7 +264,7 @@ export default {
totalDjCost: sum[2] / 100, totalDjCost: sum[2] / 100,
totalThirdPartyCost: sum[3] / 100, totalThirdPartyCost: sum[3] / 100,
totalUpgradeProductCost: sum[4] / 100, totalUpgradeProductCost: sum[4] / 100,
totalRecoveryCost: sum[5] / 100, // totalRecoveryCost: sum[5] / 100,
}; };
}, },
...@@ -308,6 +291,21 @@ export default { ...@@ -308,6 +291,21 @@ export default {
isQualityUpgrade, isQualityUpgrade,
isSolarFilm, isSolarFilm,
isSingleShopMode, isSingleShopMode,
async fetchMerchantGoodsCode({ pageQuery }) {
const res = await postComboOldMerchantGoodsCodeList({
...pageQuery,
merchantIds: Array.isArray(this.merchantId) ? this.merchantId : [this.merchantId],
baseSceneCode: this.baseSceneCode,
productName: pageQuery.searchValue,
});
return {
list: res.list,
query: {
pages: res.pages,
total: res.total,
},
};
},
getProductDisabledPositions(upgradeGoodsId, excludeMerchantGoodsCode) { getProductDisabledPositions(upgradeGoodsId, excludeMerchantGoodsCode) {
return this.productList.filter(item => item.upgradeGoodsId === upgradeGoodsId && item.merchantGoodsCode !== excludeMerchantGoodsCode).map(item => item.detailList?.[0]?.position); return this.productList.filter(item => item.upgradeGoodsId === upgradeGoodsId && item.merchantGoodsCode !== excludeMerchantGoodsCode).map(item => item.detailList?.[0]?.position);
}, },
...@@ -324,7 +322,6 @@ export default { ...@@ -324,7 +322,6 @@ export default {
upgradeCommodityCode: upgradeGoods.commodityCode, upgradeCommodityCode: upgradeGoods.commodityCode,
upgradeGoodsId: upgradeGoods.id, upgradeGoodsId: upgradeGoods.id,
upgradeGoodsName: upgradeGoods.upgradeGoodsName, upgradeGoodsName: upgradeGoods.upgradeGoodsName,
}); });
} }
}, },
......
...@@ -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;
} }
......
...@@ -62,6 +62,7 @@ export default { ...@@ -62,6 +62,7 @@ export default {
if (!commodityCode) { if (!commodityCode) {
return; return;
} }
// 查询运营成本
const { operationCost } = await getOperationCost({ const { operationCost } = await getOperationCost({
commodityCode, commodityCode,
merchantIdList: this.merchantIdList, merchantIdList: this.merchantIdList,
...@@ -75,7 +76,6 @@ export default { ...@@ -75,7 +76,6 @@ export default {
}, },
// product.detailList[0].upgradeGoods.commodityCode // product.detailList[0].upgradeGoods.commodityCode
async validate() { async validate() {
console.log("进得来?");
const modifyRef = this.$refs.modifyRef; const modifyRef = this.$refs.modifyRef;
if (!modifyRef) { if (!modifyRef) {
// 尚未初始化 // 尚未初始化
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
<div v-if="showDialog" <div v-if="showDialog"
v-loading="loading" v-loading="loading"
class="selected-product-wrapper"> class="selected-product-wrapper">
<d2-search class="show-search" <d2-search v-if="table.formSchema.length"
class="show-search"
label-width="100px" label-width="100px"
:form-data="table.formSchema" :form-data="table.formSchema"
:search-form="table.form"> :search-form="table.form">
...@@ -57,6 +58,9 @@ ...@@ -57,6 +58,9 @@
@change="handleGoodsCascaderChange($event)"> @change="handleGoodsCascaderChange($event)">
</el-cascader> </el-cascader>
</template> </template>
<template #supplierCode>
<remote-select v-model="table.form.supplierCode"></remote-select>
</template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button :id="table.props.btnId" <el-button :id="table.props.btnId"
...@@ -181,6 +185,7 @@ export default { ...@@ -181,6 +185,7 @@ export default {
goodsName: "", goodsName: "",
baseGoodsCommodityCode: "", baseGoodsCommodityCode: "",
tempGoodsType: [], tempGoodsType: [],
supplierCode: "",
}, },
props: selectGoodsTableSchema, props: selectGoodsTableSchema,
api: getUpgradeProductList, api: getUpgradeProductList,
...@@ -215,7 +220,7 @@ export default { ...@@ -215,7 +220,7 @@ export default {
this.selectedId = this.activeId; this.selectedId = this.activeId;
await this.getSelectedRow(); await this.getSelectedRow();
// this.keyDowmGetList 不知道在哪里设置的全局变量. 原有组件中需要传入 // this.keyDowmGetList 不知道在哪里设置的全局变量. 原有组件中需要传入
this.table.formSchema = getSelectGoodsTableFilterSchema(this.keyDowmGetList); this.table.formSchema = await getSelectGoodsTableFilterSchema(this.keyDowmGetList);
await this.getOptionsList(); await this.getOptionsList();
} finally { } finally {
this.loading = false; this.loading = false;
...@@ -262,6 +267,9 @@ export default { ...@@ -262,6 +267,9 @@ export default {
this.table.form[key] = e.replace(/[^a-z0-9]/gi, ""); this.table.form[key] = e.replace(/[^a-z0-9]/gi, "");
} }
}, },
keyDowmGetList() {
this.$refs?.tableRef?.refreshTable();
},
async getOptionsList() { async getOptionsList() {
// 获取全部类目 屏蔽服务商自建类目 // 获取全部类目 屏蔽服务商自建类目
const res = await getAllCategory({ categoryTypeList: baseConfig.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }); const res = await getAllCategory({ categoryTypeList: baseConfig.selfBuildGoodsType, pageSize: 9999, currentPage: 1 });
......
...@@ -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">
...@@ -84,6 +86,7 @@ ...@@ -84,6 +86,7 @@
ref="productRefs" ref="productRefs"
:base-scene-code="baseSceneCode" :base-scene-code="baseSceneCode"
:edit-state="editState" :edit-state="editState"
:merchant-id="merchantId"
:merchant-id-list="merchantIdList" :merchant-id-list="merchantIdList"
:product="productDetail || { detailList: [] }" :product="productDetail || { detailList: [] }"
:shelf-type="shelfType" :shelf-type="shelfType"
...@@ -93,6 +96,7 @@ ...@@ -93,6 +96,7 @@
ref="packageRefs" ref="packageRefs"
:base-scene-code="baseSceneCode" :base-scene-code="baseSceneCode"
:edit-state="editState" :edit-state="editState"
:merchant-id="merchantId"
:merchant-id-list="merchantIdList" :merchant-id-list="merchantIdList"
:packages="productDetail || { detailList: [] }" :packages="productDetail || { detailList: [] }"
:prefix="$data._prefix" :prefix="$data._prefix"
...@@ -151,6 +155,10 @@ export default { ...@@ -151,6 +155,10 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
merchantId: {
type: [Number, Array],
required: true,
},
shelfType: { shelfType: {
type: Number, type: Number,
required: true, required: true,
...@@ -246,10 +254,27 @@ export default { ...@@ -246,10 +254,27 @@ export default {
// 获取 某个商品/套餐 详情 // 获取 某个商品/套餐 详情
async getProductPackageDetail(id) { async getProductPackageDetail(id) {
const detail = await getProductPackagesDetailApi({ id }); const detail = await getProductPackagesDetailApi({ id });
// 如果是商品
if (detail.productType === 1) { if (detail.productType === 1) {
// 商品在这个层级依赖 // 商品在这个层级依赖
detail.upgradeGoodsId = detail.detailList[0].upgradeGoodsId; detail.upgradeGoodsId = detail.detailList[0].upgradeGoodsId;
// 若无嘀加成本则默认=0
if (detail?.detailList?.[0]?.upgradeGoods) {
if (!detail?.detailList?.[0]?.upgradeGoods?.djCost) {
detail.detailList[0].upgradeGoods.djCost = 0;
}
}
// 5.8.6 若产品供应方=广联直营,则第三方成本默认=0且不可编辑
if (detail?.detailList?.[0]?.supplyFlag === 1) {
// 第三方成本
detail.detailList[0].thirdPartyCost = 0;
}
// ●赠送成本(仅精品升级场景存在)
// ○根据根据“商品上架表”,即上架商品匹配行中取对应的“是否作为赠送产品”
// TODO 5.8.6 ○若是则自动带入对应的产品、升级成本,成本的获取方式与产品、升级成本一致;
// TODO 5.8.6 ○若否则默认为空
} }
detail.shelfType = this.shelfType; detail.shelfType = this.shelfType;
detail.baseSceneCode = this.baseSceneCode; detail.baseSceneCode = this.baseSceneCode;
return detail; return detail;
......
import { getBrandSupplyMerchant } from "@api/product";
import { get } from "lodash-es"; import { get } from "lodash-es";
import { nanoid } from "nanoid"; import { nanoid } from "nanoid";
import { BaseData, settlementTypeOpt } from "@/common/constants"; import { BaseData, settlementTypeOpt } from "@/common/constants";
...@@ -64,7 +65,6 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -64,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));
}, },
...@@ -82,7 +82,7 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -82,7 +82,7 @@ export async function getProductDetailDescriptionSchema(shelfType) {
); );
}, },
isHide({ formModel }) { isHide({ formModel }) {
// 单店模式才存在; // 单店模式存在
return !(isSingleShopMode(shelfType)); return !(isSingleShopMode(shelfType));
}, },
}, },
...@@ -92,16 +92,15 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -92,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));
}, },
}, },
...@@ -123,6 +122,31 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -123,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",
...@@ -150,19 +174,6 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -150,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: "售价/件",
...@@ -239,23 +250,23 @@ export async function getProductDetailDescriptionSchema(shelfType) { ...@@ -239,23 +250,23 @@ export async function getProductDetailDescriptionSchema(shelfType) {
}, },
}, },
{ // {
name: "detailList.0.recoveryCost", // name: "detailList.0.recoveryCost",
label: "回收成本", // label: "回收成本",
col: 12, // col: 12,
render(h, { data, schemaItem }) { // render(h, { data, schemaItem }) {
const value = isZeroOrNumber(get(data, schemaItem.name)); // const value = isZeroOrNumber(get(data, schemaItem.name));
return h( // return h(
"span", // "span",
value === "-" ? value : `${value}元`, // value === "-" ? value : `${value}元`,
// priceFilter(data.recoveryCost), // // priceFilter(data.recoveryCost),
); // );
}, // },
isHide({ formModel }) { // isHide({ formModel }) {
// 仅精品升级场景存在 // // 仅精品升级场景存在
return !(isQualityUpgrade(formModel.baseSceneCode)); // return !(isQualityUpgrade(formModel.baseSceneCode));
}, // },
}, // },
// 套餐加载时不展示 // 套餐加载时不展示
{ {
...@@ -551,6 +562,18 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -551,6 +562,18 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
); );
}, },
}, },
{
name: "detailList.0.upgradeGoods.purchaseCost",
label: "采购成本/元",
col: 8,
render(h, { data, schemaItem }) {
const value = isZeroOrNumber(get(data, schemaItem.name));
return h(
"span",
value === "-" ? value : `${value}元`,
);
},
},
]; ];
} }
...@@ -615,16 +638,16 @@ export async function getPackagesDetailDescriptionSchema(shelfType) { ...@@ -615,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));
}, },
}, },
{ {
...@@ -640,18 +663,18 @@ export async function getPackagesDetailDescriptionSchema(shelfType) { ...@@ -640,18 +663,18 @@ export async function getPackagesDetailDescriptionSchema(shelfType) {
); );
}, },
}, },
{ // {
name: "salesProportionPercent", // name: "salesProportionPercent",
label: "销售占比", // label: "销售占比",
col: 12, // col: 12,
render(h, { data, schemaItem }) { // render(h, { data, schemaItem }) {
const value = isZeroOrNumber(get(data, schemaItem.name)); // const value = isZeroOrNumber(get(data, schemaItem.name));
return h( // return h(
"span", // "span",
value === "-" ? value : value + "%", // value === "-" ? value : value + "%",
); // );
}, // },
}, // },
{ {
name: "sellPrice", name: "sellPrice",
label: "售价/件", label: "售价/件",
...@@ -701,19 +724,19 @@ export async function getPackagesDetailDescriptionSchema(shelfType) { ...@@ -701,19 +724,19 @@ export async function getPackagesDetailDescriptionSchema(shelfType) {
return h("span", value); return h("span", value);
}, },
}, },
{ // {
name: "recoveryCost", // name: "recoveryCost",
label: "回收成本", // label: "回收成本",
col: 12, // col: 12,
isHide({ formModel }) { // isHide({ formModel }) {
// 仅精品升级场景存在; // // 仅精品升级场景存在;
return !(isQualityUpgrade(formModel.baseSceneCode)); // return !(isQualityUpgrade(formModel.baseSceneCode));
}, // },
render(h, { data, schemaItem }) { // render(h, { data, schemaItem }) {
const value = schemaSumBy(data.detailList, schemaItem.name); // const value = schemaSumBy(data.detailList, schemaItem.name);
return h("span", value); // return h("span", value);
}, // },
}, // },
]; ];
} }
...@@ -777,6 +800,15 @@ export const selectGoodsTableSchema = { ...@@ -777,6 +800,15 @@ export const selectGoodsTableSchema = {
}, },
}, },
{ {
label: "采购成本/元",
prop: "purchaseCost",
width: 100,
formatter: (row) => {
const value = isZeroOrNumber(row.purchaseCost);
return value === "-" ? value : `${value}元`;
},
},
{
label: "适用区域", label: "适用区域",
prop: "upgradeGoodsAreaList", prop: "upgradeGoodsAreaList",
width: 180, width: 180,
...@@ -834,7 +866,10 @@ export const selectGoodsTableSchema = { ...@@ -834,7 +866,10 @@ export const selectGoodsTableSchema = {
}; };
// 选择商品表格筛选项 // 选择商品表格筛选项
export function getSelectGoodsTableFilterSchema(keyDownGetList) { export async function getSelectGoodsTableFilterSchema(keyDownGetList) {
// 获取品牌方 / 供应方数据 1 - 品牌商 ; 2 - 供应方
const supplierCodeList = await getBrandSupplyMerchant({ partitionFlag: 2 });
console.log("supplierCodeList", supplierCodeList);
return [ return [
{ {
label: "产品名称", label: "产品名称",
...@@ -893,5 +928,13 @@ export function getSelectGoodsTableFilterSchema(keyDownGetList) { ...@@ -893,5 +928,13 @@ export function getSelectGoodsTableFilterSchema(keyDownGetList) {
name: "goodsType", name: "goodsType",
addHtml: "goodsCascader", addHtml: "goodsCascader",
}, },
{
label: "供应商",
name: "supplierCode",
type: "select",
optionList: supplierCodeList,
optionId: "id",
optionLabel: "relatedPartyName",
},
]; ];
} }
...@@ -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,
], ],
); );
}, },
......
export const statusOptions = [ export const statusOptions = [
{ value: 0, label: "草稿" }, { value: 0, label: "草稿" },
{ value: 1, label: "待审核" }, { value: 1, label: "商务审核" },
{ value: 2, label: "已审核" }, { value: 2, label: "已完成" },
{ value: 3, label: "驳回" }, { value: 3, label: "驳回" },
{ value: 5, label: "审核提交中" }, { value: 5, label: "数据处理中" },
{ value: 6, label: "审核提交失败" }, { value: 6, label: "数据处理失败" },
]; ];
// 商品上架 业务场景 第0位必须是 精品升级 // 商品上架 业务场景 第0位必须是 精品升级
export const sceneTypeOptions = [ export const sceneTypeOptions = [
...@@ -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",
...@@ -40,7 +46,7 @@ export const realityShopLevelOptions = [ ...@@ -40,7 +46,7 @@ export const realityShopLevelOptions = [
// 上架模式 // 上架模式
export const shelfModelOptions = [ export const shelfModelOptions = [
{ value: 1, label: "特殊商品上架" }, { value: 1, label: "特殊商品上架" },
{ value: 2, label: "常规商品上架" }, { value: 2, label: "常规上架" },
]; ];
// 上架类型 // 上架类型
......
...@@ -92,11 +92,20 @@ export function getTableFilterIds(baseSceneCode) { ...@@ -92,11 +92,20 @@ export function getTableFilterIds(baseSceneCode) {
return sceneTypeFilter[sceneType] || []; return sceneTypeFilter[sceneType] || [];
} }
// "产品成本获取方式 1-自定义成本 2-默认带入产品成本" --> /**
* "产品成本获取方式 1-自定义成本 -->
* @param {*} upgradeProductCostStyle
* @returns
*/
export function isUpgradeProductCostStyleCustom(upgradeProductCostStyle) { export function isUpgradeProductCostStyleCustom(upgradeProductCostStyle) {
return upgradeProductCostStyle === 1; return upgradeProductCostStyle === 1;
} }
/**
* 产品成本获取方式 2-默认带入产品成本"
* @param {*} upgradeProductCostStyle
* @returns
*/
export function isUpgradeProductCostStyleDefault(upgradeProductCostStyle) { export function isUpgradeProductCostStyleDefault(upgradeProductCostStyle) {
return upgradeProductCostStyle === 2; return upgradeProductCostStyle === 2;
} }
...@@ -104,7 +113,7 @@ export function isUpgradeProductCostStyleDefault(upgradeProductCostStyle) { ...@@ -104,7 +113,7 @@ export function isUpgradeProductCostStyleDefault(upgradeProductCostStyle) {
/** /**
* 是否直营 * 是否直营
* 权益、延保 且 供应方=广联直营 0-否 1-是 * 权益、延保 且 供应方=广联直营 0-否 1-是
* @returns Boolean * @returns
*/ */
export function isDirectOperation(supplyFlag) { export function isDirectOperation(supplyFlag) {
return supplyFlag === 1; return supplyFlag === 1;
......
...@@ -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">
...@@ -139,6 +140,10 @@ import ShelfProductImport from "../../components/shelfProductImport/index.vue"; ...@@ -139,6 +140,10 @@ import ShelfProductImport from "../../components/shelfProductImport/index.vue";
// 业务层(FormStep + 各种组件) // 业务层(FormStep + 各种组件)
// └── 只负责:输入 / 校验 / 数据 // └── 只负责:输入 / 校验 / 数据
/**
* 特殊上架
*/
const shelfModel = 1;
export default { export default {
name: "ShelfProductModify", name: "ShelfProductModify",
components: { components: {
...@@ -218,9 +223,10 @@ export default { ...@@ -218,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) {
...@@ -315,6 +321,8 @@ export default { ...@@ -315,6 +321,8 @@ export default {
const fileExt = stepFormData.goodsCreateExcel.name.split("."); const fileExt = stepFormData.goodsCreateExcel.name.split(".");
const reqData = { const reqData = {
...stepFormData, ...stepFormData,
// 特殊上架
shelfModel,
file: last(fileExt) + "@" + arrBase64, file: last(fileExt) + "@" + arrBase64,
}; };
if (!reqData.businessCode) { if (!reqData.businessCode) {
......
<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="merchantIdList"
: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,
merchantIdList: undefined,
logList: [],
};
},
computed: {
isReadyForNextStep() {
return this.baseSceneCode && this.businessCode && this.shelfType && this.merchantIdList;
},
},
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>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<el-steps finish-status="success" :active="step.confirmStep"> <el-steps finish-status="success" :active="step.confirmStep">
<el-step title="1、商品上架表导入"></el-step> <el-step title="1、商品上架表导入"></el-step>
<el-step title="2、上架商品确认"></el-step> <el-step title="2、上架商品确认"></el-step>
<el-step title="3、利润率测算"></el-step> <el-step v-if="isSingleShopMode(shelfType)" title="3、利润率测算"></el-step>
</el-steps> </el-steps>
</div> </div>
<div v-loading="data.isProviderLoading" class="wrapper"> <div v-loading="data.isProviderLoading" class="wrapper">
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
<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" <FormStep v-loading="data.isStepLoading"
name="ProfitMarginTable" name="ProfitMarginTable"
style="height:100%"> style="height:100%">
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
@click="handlePreviousSteps"> @click="handlePreviousSteps">
上一步 上一步
</VenusButton> </VenusButton>
<VenusButton v-if="step.confirmStep < 2" <VenusButton v-if="step.confirmStep < (isSingleShopMode(shelfType) ? 2 : 1)"
size="small" size="small"
type="primary" type="primary"
:disabled="data.isEditing || data.isSaving" :disabled="data.isEditing || data.isSaving"
...@@ -107,7 +107,7 @@ import { ...@@ -107,7 +107,7 @@ import {
} from "@/views/goods/shelfProduct/api"; } from "@/views/goods/shelfProduct/api";
import { sceneTypeOptions, VIEW_MODE } from "@/views/goods/shelfProduct/constant/index"; import { sceneTypeOptions, VIEW_MODE } from "@/views/goods/shelfProduct/constant/index";
import { getMemberRightsUpgradeValue, isMemberRightsUpgrade, isQualityUpgrade } from "@/views/goods/shelfProduct/utils/status"; import { getMemberRightsUpgradeValue, isMemberRightsUpgrade, isQualityUpgrade, isSingleShopMode } from "@/views/goods/shelfProduct/utils/status";
import VenusButton from "../../components/btn/index.vue"; import VenusButton from "../../components/btn/index.vue";
import FormStep from "../../components/formProvider/formStep.vue"; import FormStep from "../../components/formProvider/formStep.vue";
import FormProvider from "../../components/formProvider/index.vue"; import FormProvider from "../../components/formProvider/index.vue";
...@@ -124,6 +124,10 @@ import ShelfProductImport from "../../components/shelfProductImport/index.vue"; ...@@ -124,6 +124,10 @@ import ShelfProductImport from "../../components/shelfProductImport/index.vue";
// 业务层(FormStep + 各种组件) // 业务层(FormStep + 各种组件)
// └── 只负责:输入 / 校验 / 数据 // └── 只负责:输入 / 校验 / 数据
/**
* 常规上架
*/
const shelfModel = 2;
export default { export default {
name: "ShelfProductModify", name: "ShelfProductModify",
components: { components: {
...@@ -152,6 +156,7 @@ export default { ...@@ -152,6 +156,7 @@ export default {
baseSceneCode: undefined, baseSceneCode: undefined,
businessCode: undefined, businessCode: undefined,
shelfType: undefined, shelfType: undefined,
merchantId: undefined,
}; };
}, },
...@@ -169,6 +174,7 @@ export default { ...@@ -169,6 +174,7 @@ export default {
async created() { async created() {
this.setShelfProductInfo(this.$route.query); this.setShelfProductInfo(this.$route.query);
await this.$nextTick(); await this.$nextTick();
// 如果是编辑
if (this.isReadyForNextStep) { if (this.isReadyForNextStep) {
await this.init(); await this.init();
} }
...@@ -182,6 +188,7 @@ export default { ...@@ -182,6 +188,7 @@ export default {
getMemberRightsUpgradeValue, getMemberRightsUpgradeValue,
isMemberRightsUpgrade, isMemberRightsUpgrade,
isQualityUpgrade, isQualityUpgrade,
isSingleShopMode,
async withLoading(fn) { async withLoading(fn) {
if (!isFunction(fn)) { if (!isFunction(fn)) {
return; return;
...@@ -200,18 +207,25 @@ export default { ...@@ -200,18 +207,25 @@ export default {
}); });
}, },
async getStep() { async getStep() {
const { confirmStep } = await getShelfProductUpdateStep({ const { confirmStep, merchantId } = await getShelfProductUpdateStep({
businessCode: this.businessCode, businessCode: this.businessCode,
}); });
this.merchantId = merchantId;
// 常规上架特殊处理
if ((confirmStep - 1) > 2) {
return 2;
}
return confirmStep - 1; return confirmStep - 1;
}, },
async beforeChangeStepBefore(isNext) { async beforeChangeStepBefore(isNext) {
this.btnLoading = true; this.btnLoading = true;
try { try {
// 常规上架特殊处理
const confirmStep = this.step.confirmStep + 1;
await putShelfProductUpdateStep({ await putShelfProductUpdateStep({
businessCode: this.businessCode, businessCode: this.businessCode,
nextStep: isNext, nextStep: isNext,
confirmStep: this.step.confirmStep + 1, confirmStep: confirmStep === 3 ? 5 : confirmStep,
}); });
} finally { } finally {
this.btnLoading = false; this.btnLoading = false;
...@@ -273,6 +287,8 @@ export default { ...@@ -273,6 +287,8 @@ export default {
const fileExt = stepFormData.goodsCreateExcel.name.split("."); const fileExt = stepFormData.goodsCreateExcel.name.split(".");
const reqData = { const reqData = {
...stepFormData, ...stepFormData,
// 常规上架
shelfModel,
file: last(fileExt) + "@" + arrBase64, file: last(fileExt) + "@" + arrBase64,
}; };
if (!reqData.businessCode) { if (!reqData.businessCode) {
...@@ -293,6 +309,7 @@ export default { ...@@ -293,6 +309,7 @@ export default {
componentsRef.setImportProgressState("starting"); componentsRef.setImportProgressState("starting");
const that = this; const that = this;
async function stopCondition([result]) { async function stopCondition([result]) {
console.log("stopCondition", result.progress);
// 更新数据 // 更新数据
// 失败 // 失败
componentsRef.setProgress(result.progress); componentsRef.setProgress(result.progress);
...@@ -301,11 +318,15 @@ export default { ...@@ -301,11 +318,15 @@ export default {
await syncTime(500); await syncTime(500);
} }
if (isSuccess(result.progress, result.failNum)) { if (isSuccess(result.progress, result.failNum)) {
console.log("成功?");
componentsRef.setImportProgressState("success"); componentsRef.setImportProgressState("success");
console.log("1?");
const res = await getShelfProductBaseInfoByUUIDApi({ uuid: result.uuid }); const res = await getShelfProductBaseInfoByUUIDApi({ uuid: result.uuid });
console.log("isSuccess", res); console.log("2?", res);
console.log("isSuccess", that.baseSceneCode);
that.setShelfProductInfo(pick(res, "baseSceneCode", "businessCode", "shelfType")); that.setShelfProductInfo(pick(res, "baseSceneCode", "businessCode", "shelfType"));
console.log("3?");
that.merchantId = res.merchantId;
return true; return true;
} }
if (isFail(result.progress, result.failNum)) { if (isFail(result.progress, result.failNum)) {
......
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header> <d2-table-header>
<span style=" display:flex; gap:8px; "> <span style=" display:flex; gap:8px; ">
<!-- 常规上架 handleModify --> <!-- 常规上架 handleNormalModify -->
<auth-button category="Button" <auth-button category="Button"
:data="{ operate: 'create' }" :data="{ operate: 'create', record: { shelfModel: 2 } }"
:show-btn-ids="['9031810']" /> :show-btn-ids="['9031810']" />
<!-- 特殊商品上架 handleModify --> <!-- 特殊商品上架 handleModify -->
<auth-button category="Button" <auth-button category="Button"
:data="{ operate: 'create' }" :data="{ operate: 'create', record: { shelfModel: 1 } }"
:show-btn-ids="['9031801']" /> :show-btn-ids="['9031801']" />
</span> </span>
</d2-table-header> </d2-table-header>
...@@ -51,19 +51,23 @@ ...@@ -51,19 +51,23 @@
<template #auth-button="{ scope }"> <template #auth-button="{ scope }">
<div style="padding:21px 0"> <div style="padding:21px 0">
<!-- 查看 handleDetail --> <!-- 查看 handleDetail -->
<!-- 全部状态的单据均可操作 -->
<span style="margin-right: 10px"> <span style="margin-right: 10px">
<auth-button :data="scope" :show-btn-ids="['9031803']" /> <auth-button :data="scope" :show-btn-ids="['9031803']" />
</span> </span>
<!-- 编辑 handleModify 仅草稿出现 --> <!-- 编辑 handleModify 仅草稿出现 -->
<!-- 仅状态=“草稿”的记录可操作 -->
<span v-if="scope.systemStatus === 0" style="margin-right: 10px"> <span v-if="scope.systemStatus === 0" style="margin-right: 10px">
<auth-button :data="{ operate: 'edit', record: scope }" :show-btn-ids="['9031806']" /> <auth-button :data="{ operate: 'edit', record: scope }" :show-btn-ids="['9031806']" />
</span> </span>
<!-- 驳回 handleReject 待审核才出现 --> <!-- 驳回 handleReject 待审核才出现 -->
<!-- 仅状态=“商务审核” -->
<span v-if="scope.systemStatus === 1" style="margin-right: 10px"> <span v-if="scope.systemStatus === 1" style="margin-right: 10px">
<auth-button :data="scope" <auth-button :data="scope"
:show-btn-ids="['9031808']" /> :show-btn-ids="['9031808']" />
</span> </span>
<!-- 审核 handleApprove 待审核才出现 --> <!-- 审核 handleApprove 待审核才出现 -->
<!-- 仅状态=“商务审核”的记录可操作 -->
<span v-if="scope.systemStatus === 1" style="margin-right: 10px"> <span v-if="scope.systemStatus === 1" style="margin-right: 10px">
<auth-button :data="scope" :show-btn-ids="['9031809']" /> <auth-button :data="scope" :show-btn-ids="['9031809']" />
</span> </span>
...@@ -94,6 +98,7 @@ export default { ...@@ -94,6 +98,7 @@ export default {
}, },
data() { data() {
return { return {
isCacheLoaded: false,
table: { table: {
formSchema: cloneDeep(shelfProductTableFormSchema), formSchema: cloneDeep(shelfProductTableFormSchema),
getListApi: getShelfProductPageApi, getListApi: getShelfProductPageApi,
...@@ -124,11 +129,13 @@ export default { ...@@ -124,11 +129,13 @@ export default {
}; };
}, },
async mounted() { async mounted() {
console.log("mounted");
await this.getBaseData(); await this.getBaseData();
}, },
activated() { activated() {
this.$refs?.tableRef?.refreshTable(); if (this.isCacheLoaded) {
this.$refs?.tableRef?.refreshTable();
}
this.isCacheLoaded = true;
}, },
methods: { methods: {
...@@ -168,12 +175,9 @@ export default { ...@@ -168,12 +175,9 @@ export default {
}, },
// 常规上架 // 常规上架
handleNormalModify({ operate, record }) { handleNormalModify({ operate, record }) {
console.log("????"); this.$router.push({
if (operate === "create") { name: "goodsShelfNormalModify",
this.$router.push({ });
name: "goodsShelfNormalCreate",
});
}
}, },
handleRefreshTable() { handleRefreshTable() {
this.$refs.tableRef.refreshTable(); this.$refs.tableRef.refreshTable();
...@@ -185,34 +189,74 @@ export default { ...@@ -185,34 +189,74 @@ export default {
}, },
// 查看 // 查看
handleDetail(row) { handleDetail(row) {
this.$router.push({ if (row.shelfModel === 1) {
name: "goodsShelfDetail", // 特殊上架详情
query: {
baseSceneCode: row.baseSceneCode,
businessCode: row.businessCode,
shelfType: row.shelfType,
},
});
},
// 新增 或 修改
handleModify({ operate, record }) {
if (operate === "create") {
this.$router.push({ this.$router.push({
name: "goodsShelfCreate", name: "goodsShelfDetail",
query: {
baseSceneCode: row.baseSceneCode,
businessCode: row.businessCode,
shelfType: row.shelfType,
},
}); });
} }
if (row.shelfModel === 2) {
if (operate === "edit") { // 常规上架详情
this.$router.push({ this.$router.push({
name: "goodsShelfModify", name: "goodsShelfNormalDetail",
query: { query: {
baseSceneCode: record.baseSceneCode, baseSceneCode: row.baseSceneCode,
businessCode: record.businessCode, businessCode: row.businessCode,
shelfType: record.shelfType, shelfType: row.shelfType,
shelfModel: row.shelfModel,
}, },
}); });
} }
}, },
// 新增 或 修改
handleModify({ operate, record }) {
console.log(record);
// 特殊上架编辑
if (record?.shelfModel === 1) {
if (operate === "create") {
this.$router.push({
name: "goodsShelfCreate",
});
}
if (operate === "edit") {
this.$router.push({
name: "goodsShelfModify",
query: {
baseSceneCode: record.baseSceneCode,
businessCode: record.businessCode,
shelfType: record.shelfType,
},
});
}
}
if (record?.shelfModel === 2) {
if (operate === "create") {
this.$router.push({
name: "goodsShelfNormalModify",
});
}
if (operate === "edit") {
this.$router.push({
name: "goodsShelfNormalModify",
query: {
baseSceneCode: record.baseSceneCode,
businessCode: record.businessCode,
shelfType: record.shelfType,
shelfModel: record.shelfModel,
},
});
}
}
},
}, },
}; };
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!