Commit 0c637ea9 by Jaxon

feat: 业务开发

1 parent fce7a71a
...@@ -19,8 +19,9 @@ const IMAGE_EXTENSIONS = ["jpg", "jpeg", "png", "gif", "webp", "bmp", "svg", "ic ...@@ -19,8 +19,9 @@ const IMAGE_EXTENSIONS = ["jpg", "jpeg", "png", "gif", "webp", "bmp", "svg", "ic
* @returns {boolean} * @returns {boolean}
*/ */
export function isImageFile(fileName) { export function isImageFile(fileName) {
if (!fileName || typeof fileName !== "string") if (!fileName || typeof fileName !== "string") {
return false; return false;
}
const ext = fileName.split(".").pop()?.toLowerCase(); const ext = fileName.split(".").pop()?.toLowerCase();
return IMAGE_EXTENSIONS.includes(ext); return IMAGE_EXTENSIONS.includes(ext);
} }
...@@ -681,16 +681,31 @@ export const routerName = { ...@@ -681,16 +681,31 @@ export const routerName = {
}, },
auth: [ auth: [
{ {
authId: "9031810",
parentId: "90318",
label: "常规上架",
category: "Button",
type: "primary",
handle: "handleNormalModify",
addRoutePath: [
{
authId: "90318101",
name: "常规上架",
parentId: "90318",
},
],
},
{
authId: "9031801", authId: "9031801",
parentId: "90318", parentId: "90318",
label: "新增商品上架", label: "特殊商品上架",
category: "Button", category: "Button",
type: "primary", type: "primary",
handle: "handleModify", handle: "handleModify",
addRoutePath: [ addRoutePath: [
{ {
authId: "9031802", authId: "9031802",
name: "新增商品上架", name: "特殊商品上架",
parentId: "90318", parentId: "90318",
}, },
], ],
...@@ -736,11 +751,25 @@ export const routerName = { ...@@ -736,11 +751,25 @@ export const routerName = {
], ],
component: _import("goods/shelfProduct/view/table/index"), component: _import("goods/shelfProduct/view/table/index"),
}, },
90318101: {
path: "/goods-shelf/normal-modify",
name: "goodsShelfNormalCreate",
meta: {
title: "常规上架",
authId: "90318101",
parentId: "90318",
sideHidden: true,
activePath: "/goods-shelf",
},
component: _import("goods/shelfProduct/view/normalModify/index"),
},
9031802: { 9031802: {
path: "/goods-shelf/modify", path: "/goods-shelf/modify",
name: "goodsShelfCreate", name: "goodsShelfCreate",
meta: { meta: {
title: "新增商品上架", title: "特殊商品上架",
authId: "9031802", authId: "9031802",
parentId: "90318", parentId: "90318",
sideHidden: true, sideHidden: true,
......
...@@ -270,7 +270,11 @@ export default { ...@@ -270,7 +270,11 @@ export default {
throw new Error("正在保存,请稍后"); throw new Error("正在保存,请稍后");
} }
const step = this.steps[this.currentStep]; const step = this.steps[this.currentStep];
await this.validate(step.name); try {
await this.validate(step.name);
} catch (err) {
console.log("校验失败", err);
}
await this.submitStep(step.name); await this.submitStep(step.name);
if (next) { if (next) {
this.$emit("stepChange", this.currentStep + 1); this.$emit("stepChange", this.currentStep + 1);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
:edit-state="VIEW_MODE.VIEW" :edit-state="VIEW_MODE.VIEW"
:merchant-id-list="merchantIdList" :merchant-id-list="merchantIdList"
:product="productData" :product="productData"
:shelf-type="shelfType"
:show-business-line="false" :show-business-line="false"
:show-gift-cost="false" :show-gift-cost="false"
:show-penetration-rate="false" :show-penetration-rate="false"
...@@ -38,6 +39,10 @@ export default { ...@@ -38,6 +39,10 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
shelfType: {
type: Number,
default: 1,
},
packages: { packages: {
type: Object, type: Object,
default: () => ({ }), default: () => ({ }),
......
...@@ -150,6 +150,7 @@ ...@@ -150,6 +150,7 @@
:edit-state="VIEW_MODE.EDIT" :edit-state="VIEW_MODE.EDIT"
:merchant-id-list="merchantIdList" :merchant-id-list="merchantIdList"
:product.sync="goodsForm" :product.sync="goodsForm"
:shelf-type="shelfType"
:show-gift-cost="false" :show-gift-cost="false"
:show-sales-proportion-percent="false" :show-sales-proportion-percent="false"
:show-settlement-type="false" :show-settlement-type="false"
...@@ -196,6 +197,10 @@ export default { ...@@ -196,6 +197,10 @@ export default {
type: Object, type: Object,
default: () => ({ }), default: () => ({ }),
}, },
shelfType: {
type: Number,
default: 1,
},
}, },
data() { data() {
return { return {
......
...@@ -48,6 +48,38 @@ ...@@ -48,6 +48,38 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- TODO: 改字段名 -->
<el-col v-if="isSingleShopMode(shelfType)" :span="24">
<el-form-item label="上架类型:"
prop="detailList[0].position"
:rules="[{ required: true, message: '请选择上架部位', trigger: 'change' }]">
<el-radio-group v-model="product.detailList[0].position">
<template v-for="item in options.shelfClassOptions">
<el-radio :key="item.value"
:label="item.value">
{{ item.label }}
</el-radio>
</template>
</el-radio-group>
</el-form-item>
</el-col>
<!-- TODO: 且上架类型的值 为 修改 才显示 -->
<el-col v-if="isSingleShopMode(shelfType) " :span="24">
<el-form-item label="原上架ID:"
prop="detailList[0].position"
:rules="[{ required: true, message: '请选择上架部位', trigger: 'change' }]">
<el-radio-group v-model="product.detailList[0].position">
<template v-for="item in options.shelfClassOptions">
<el-radio :key="item.value"
:label="item.value">
{{ item.label }}
</el-radio>
</template>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="商品别名:" prop="detailList[0].goodsAlias"> <el-form-item label="商品别名:" prop="detailList[0].goodsAlias">
<el-input v-model="product.detailList[0].goodsAlias" <el-input v-model="product.detailList[0].goodsAlias"
...@@ -57,6 +89,21 @@ ...@@ -57,6 +89,21 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 仅膜类产品存在 -->
<!-- TODO: 改字段名, options需要获取 -->
<el-col v-if="isSolarFilm(product.detailList[0].upgradeGoods.goodsInfo.goodsType)" :span="12">
<el-form-item label="服务项目:" prop="settlementType">
<el-select v-model="product.settlementType"
placeholder="请选择">
<el-option v-for="item in options.settlementType"
:key="item.confId"
:label="item.confValue"
:value="item.confId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col v-if="showSettlementType" :span="12"> <el-col v-if="showSettlementType" :span="12">
<el-form-item label="结算方式:" prop="settlementType"> <el-form-item label="结算方式:" prop="settlementType">
<el-select v-model="product.settlementType" <el-select v-model="product.settlementType"
...@@ -129,6 +176,7 @@ ...@@ -129,6 +176,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- TODO: 为空默认为0 , 这里需要前端修改还是后端直接改为0 ? -->
<el-col v-if="isMemberRightsUpgrade(baseSceneCode)" :span="12"> <el-col v-if="isMemberRightsUpgrade(baseSceneCode)" :span="12">
<el-form-item label="嘀加成本/件:" <el-form-item label="嘀加成本/件:"
prop="djCost"> prop="djCost">
...@@ -140,6 +188,7 @@ ...@@ -140,6 +188,7 @@
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- TODO: 需要字段动态判断是否可编辑, 值的获取路径 -->
<el-col v-if="isMemberRightsUpgrade(baseSceneCode)" :span="12"> <el-col v-if="isMemberRightsUpgrade(baseSceneCode)" :span="12">
<el-form-item label="第三方成本/件:" <el-form-item label="第三方成本/件:"
prop="detailList[0].thirdPartyCost" prop="detailList[0].thirdPartyCost"
...@@ -222,8 +271,8 @@ import Descriptions from "@/components/descriptions/index.vue"; ...@@ -222,8 +271,8 @@ import Descriptions from "@/components/descriptions/index.vue";
import VenusNumberInput from "@/components/venusNumberInput/index.vue"; import VenusNumberInput from "@/components/venusNumberInput/index.vue";
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 { getProductDetailUpgradeGoodsDescriptionSchema } from "@/views/goods/shelfProduct/components/shelfProductConfirm/shelfProductConfirm.data.js";
import { inventoryTypeOption } from "@/views/goods/shelfProduct/constant/index.js"; import { inventoryTypeOption, shelfClassOptions } from "@/views/goods/shelfProduct/constant/index.js";
import { isMemberRightsUpgrade, isQualityUpgrade, isSolarFilm } from "@/views/goods/shelfProduct/utils/status.js"; import { isMemberRightsUpgrade, isQualityUpgrade, isSingleShopMode, isSolarFilm } from "@/views/goods/shelfProduct/utils/status.js";
import { productFromRules } from "../../product.data.js"; import { productFromRules } from "../../product.data.js";
export default { export default {
...@@ -241,6 +290,11 @@ export default { ...@@ -241,6 +290,11 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
// 上架类型
shelfType: {
type: Number,
default: 1,
},
merchantIdList: { merchantIdList: {
type: Array, type: Array,
required: true, required: true,
...@@ -275,6 +329,7 @@ export default { ...@@ -275,6 +329,7 @@ export default {
options: { options: {
settlementType: settlementTypeOpt, settlementType: settlementTypeOpt,
inventoryType: inventoryTypeOption, inventoryType: inventoryTypeOption,
shelfClassOptions,
position: [], position: [],
}, },
dialog: { dialog: {
...@@ -312,6 +367,7 @@ export default { ...@@ -312,6 +367,7 @@ export default {
isMemberRightsUpgrade, isMemberRightsUpgrade,
isQualityUpgrade, isQualityUpgrade,
isSolarFilm, isSolarFilm,
isSingleShopMode,
showPositionItem(position) { showPositionItem(position) {
return this.product?.detailList[0]?.upgradeGoods?.positionList?.includes(position); return this.product?.detailList[0]?.upgradeGoods?.positionList?.includes(position);
}, },
......
...@@ -12,10 +12,7 @@ ...@@ -12,10 +12,7 @@
:collapse-tags="false" :collapse-tags="false"
:disabled="isEdit()" :disabled="isEdit()"
:fetch-api="getTitleOptions" :fetch-api="getTitleOptions"
:field-name="{ :field-name="{ value: 'id', label: 'productName' }"
value: 'id',
label: 'productName',
}"
:multiple="false" :multiple="false"
:options.sync="tabs.list" :options.sync="tabs.list"
:popper-append-to-body="false" :popper-append-to-body="false"
...@@ -89,6 +86,7 @@ ...@@ -89,6 +86,7 @@
:edit-state="editState" :edit-state="editState"
:merchant-id-list="merchantIdList" :merchant-id-list="merchantIdList"
:product="productDetail || { detailList: [] }" :product="productDetail || { detailList: [] }"
:shelf-type="shelfType"
@update:upgradeGoods="handleProductUpdateUpgradeGoods" /> @update:upgradeGoods="handleProductUpdateUpgradeGoods" />
<Combo v-if="productDetail.productType === 2" <Combo v-if="productDetail.productType === 2"
:key="tabsActive" :key="tabsActive"
......
...@@ -37,6 +37,18 @@ export const realityShopLevelOptions = [ ...@@ -37,6 +37,18 @@ export const realityShopLevelOptions = [
{ realityShopLevel: 2, realityShopLevelName: "上级流量方" }, { realityShopLevel: 2, realityShopLevelName: "上级流量方" },
]; ];
// 上架模式
export const shelfModelOptions = [
{ value: 1, label: "特殊商品上架" },
{ value: 2, label: "常规商品上架" },
];
// 上架类型
export const shelfClassOptions = [
{ value: 1, label: "新增" },
{ value: 2, label: "修改" },
];
// 运营周期 // 运营周期
export const settleTimeOptions = [ export const settleTimeOptions = [
{ value: 1, label: "1" }, { value: 1, label: "1" },
......
...@@ -22,8 +22,12 @@ ...@@ -22,8 +22,12 @@
</template> </template>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header> <d2-table-header>
<!-- 新增商品上架 handleModify --> <span style=" display:flex; gap:8px; ">
<span style=" display: inline-block; margin-right: 10px"> <!-- 常规上架 handleModify -->
<auth-button category="Button"
:data="{ operate: 'create' }"
:show-btn-ids="['9031810']" />
<!-- 特殊商品上架 handleModify -->
<auth-button category="Button" <auth-button category="Button"
:data="{ operate: 'create' }" :data="{ operate: 'create' }"
:show-btn-ids="['9031801']" /> :show-btn-ids="['9031801']" />
...@@ -98,6 +102,7 @@ export default { ...@@ -98,6 +102,7 @@ export default {
merchantName: "", merchantName: "",
shelfType: "", shelfType: "",
sceneType: "", sceneType: "",
shelfModel: "",
}, },
// 表格参数 // 表格参数
tableParams: { tableParams: {
...@@ -155,6 +160,15 @@ export default { ...@@ -155,6 +160,15 @@ export default {
}, },
}); });
}, },
// 常规上架
handleNormalModify({ operate, record }) {
console.log("????");
if (operate === "create") {
this.$router.push({
name: "goodsShelfNormalCreate",
});
}
},
handleRefreshTable() { handleRefreshTable() {
this.$refs.tableRef.refreshTable(); this.$refs.tableRef.refreshTable();
}, },
...@@ -176,7 +190,6 @@ export default { ...@@ -176,7 +190,6 @@ export default {
}, },
// 新增 或 修改 // 新增 或 修改
handleModify({ operate, record }) { handleModify({ operate, record }) {
console.log("record", record);
if (operate === "create") { if (operate === "create") {
this.$router.push({ this.$router.push({
name: "goodsShelfCreate", name: "goodsShelfCreate",
......
import { cloneDeep } from "lodash-es"; import { cloneDeep } from "lodash-es";
import { shelfTypeOpt } from "@/common/constants"; import { shelfTypeOpt } from "@/common/constants";
import { Util } from "@/common/util"; import { Util } from "@/common/util";
import { sceneTypeOptions, statusOptions } from "../../constant/index"; import { sceneTypeOptions, shelfModelOptions, statusOptions } from "../../constant/index";
export const shelfProductTableFormSchema = [ export const shelfProductTableFormSchema = [
{ {
...@@ -31,6 +31,15 @@ export const shelfProductTableFormSchema = [ ...@@ -31,6 +31,15 @@ export const shelfProductTableFormSchema = [
optionLabel: "label", optionLabel: "label",
}, },
{ {
label: "上架模式",
name: "shelfModel",
type: "select",
isClear: true,
optionList: cloneDeep(shelfModelOptions),
optionId: "value",
optionLabel: "label",
},
{
label: "上架类型", label: "上架类型",
name: "shelfType", name: "shelfType",
type: "select", type: "select",
...@@ -58,6 +67,14 @@ export const shelfProductTableColumn = [ ...@@ -58,6 +67,14 @@ export const shelfProductTableColumn = [
width: "180px", width: "180px",
}, },
{ {
label: "上架模式",
prop: "shelfModel",
width: "180px",
formatter: (row) => {
return shelfModelOptions.find(item => item.value === row.shelfModel)?.label || "特殊商品上架";
},
},
{
label: "上架类型", label: "上架类型",
prop: "shelfType", prop: "shelfType",
width: "150px", width: "150px",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!