Commit 0c637ea9 by Jaxon

feat: 业务开发

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