Commit 61c1a904 by 张立顺

Merge branch 'SAAS+V5.8.4' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into SAAS+V5.8.4
2 parents ca96bc32 69fe14e3
Showing 25 changed files with 432 additions and 79 deletions
...@@ -187,3 +187,15 @@ export function getOperationCost(data) { ...@@ -187,3 +187,15 @@ export function getOperationCost(data) {
data.method = 'dj.api.smartcarlife.merchantGoodsInfo.operationCost.calculate' data.method = 'dj.api.smartcarlife.merchantGoodsInfo.operationCost.calculate'
return request(data, "post") return request(data, "post")
} }
// 查询商品成本(默认带入产品成本)
export function queryMerchantGoodsCost(data) {
data.method = `dj.api.smartcarlife.merchantGoodsInfo.productCost.calculate`;
return request(data, "post");
}
// 校验门店省市是否在产品适用区域内
export function validateStoreRegion(data) {
data.method = `${path}merchantGoodsInfo.validateStoreRegion`;
return request(data, "post");
}
...@@ -164,6 +164,10 @@ export function getUpgradeProductList(data) { ...@@ -164,6 +164,10 @@ export function getUpgradeProductList(data) {
data.method = `${path}productManager.listUpgradeGoodsWithPage`; data.method = `${path}productManager.listUpgradeGoodsWithPage`;
return request(data, "post"); return request(data, "post");
} }
export function getUpgradeProductListV2(data) {
data.method = `dj.api.smartcarlife.productManager.listUpgradeGoodsWithPage.v2`;
return request(data, "post");
}
// 根据id查询商品详情 // 根据id查询商品详情
export function getBaseGoodsById(data) { export function getBaseGoodsById(data) {
......
...@@ -5,34 +5,34 @@ ...@@ -5,34 +5,34 @@
const API_NAME_MAPPING = { const API_NAME_MAPPING = {
"dj.smartcarlife": "axios", "dj.smartcarlife": "axios",
dj: "axios", "dj": "axios",
scrm: "axios2", "scrm": "axios2",
merchants: "axios3", "merchants": "axios3",
reportExport: "axios4", "reportExport": "axios4",
"glsx.accounts.biz.common.pictureUpload": "common", "glsx.accounts.biz.common.pictureUpload": "common",
clue: "axios5", "clue": "axios5",
"dj.businessSchool": "axios6", "dj.businessSchool": "axios6",
script: "axios7", "script": "axios7",
staff: "axios9", "staff": "axios9",
riskmanage: "axios10", "riskmanage": "axios10",
strategy: "axios_strategy", "strategy": "axios_strategy",
supervisor: "axios_supervisor", "supervisor": "axios_supervisor",
oaapproval: "axios_oaapproval", "oaapproval": "axios_oaapproval",
taskcenter: "axiosTaskCenter", "taskcenter": "axiosTaskCenter",
}; };
const SIGN_WAY = { const SIGN_WAY = {
"dj.smartcarlife": "sha1", "dj.smartcarlife": "sha1",
dj: "sha1", "dj": "sha1",
scrm: "sha1", "scrm": "sha1",
glsx: "md5", "glsx": "md5",
"glsx.accounts.biz.common.pictureUpload": "md5", "glsx.accounts.biz.common.pictureUpload": "md5",
clue: "sha1", "clue": "sha1",
script: "sha1", "script": "sha1",
staff: "sha1", "staff": "sha1",
riskmanage: "sha1", "riskmanage": "sha1",
oaapproval: "sha1", "oaapproval": "sha1",
taskcenter: "sha1", "taskcenter": "sha1",
}; };
/** /**
...@@ -77,7 +77,7 @@ function resolveApiName(method = "") { ...@@ -77,7 +77,7 @@ function resolveApiName(method = "") {
if (method.includes("dj.api.taskcenter")) { if (method.includes("dj.api.taskcenter")) {
return "taskcenter"; return "taskcenter";
} }
if (method.includes("merchants.api.open.createMerchantWithPermissions")) { if (method.includes("merchants.api.open.createMerchantWithPermissions") || method.includes("merchants.api.oaapproval")) {
return "oaapproval"; return "oaapproval";
} }
if (method.includes("dj.api.marketing")) { if (method.includes("dj.api.marketing")) {
......
...@@ -189,7 +189,7 @@ export const routerName = { ...@@ -189,7 +189,7 @@ export const routerName = {
title: "上架管理", title: "上架管理",
authId: "90309", authId: "90309",
parentId: "903", parentId: "903",
cache: false, cache: true,
}, },
auth: [ auth: [
{ {
...@@ -424,7 +424,7 @@ export const routerName = { ...@@ -424,7 +424,7 @@ export const routerName = {
title: "套餐管理", title: "套餐管理",
authId: "90312", authId: "90312",
parentId: "903", parentId: "903",
cache: false, cache: true,
}, },
auth: [ auth: [
{ {
......
This diff could not be displayed because it is too large.
...@@ -112,6 +112,12 @@ export const packageGoodsForm = [ ...@@ -112,6 +112,12 @@ export const packageGoodsForm = [
type: "price", type: "price",
isPrice: true, isPrice: true,
}, },
{
label: "采购成本/元",
value: "purchaseCost",
type: "price",
isPrice: true,
},
], ],
}, },
{ {
...@@ -122,6 +128,33 @@ export const packageGoodsForm = [ ...@@ -122,6 +128,33 @@ export const packageGoodsForm = [
width: "432px", width: "432px",
}, },
{ {
name: "serviceItemId",
label: "服务项目",
type: "select",
isRequired: true,
isClear: false,
optionList: [],
optionId: "serviceItemId",
optionLabel: "serviceItemsName",
width: "432px",
},
{
name: "productCostType",
label: "商品成本带入方式",
type: "flagRadio",
isRequired: true,
radioGroupList: [
{
label: "默认带入产品成本",
value: 1,
},
{
label: "自定义成本",
value: 0,
},
],
},
{
name: "goodsAlias", name: "goodsAlias",
label: "商品别名", label: "商品别名",
type: "input", type: "input",
...@@ -263,6 +296,11 @@ export const packageGoodsDetail = [ ...@@ -263,6 +296,11 @@ export const packageGoodsDetail = [
value: "operationCost", value: "operationCost",
type: "price", type: "price",
}, },
{
label: "采购成本/元",
value: "purchaseCost",
type: "price",
},
], ],
}, },
{ {
...@@ -316,4 +354,12 @@ export const packageGoodsDetail = [ ...@@ -316,4 +354,12 @@ export const packageGoodsDetail = [
label: "第三方成本", label: "第三方成本",
unit: true, unit: true,
}, },
{
name: "productCostTypeStr",
label: "商品成本带入方式",
},
{
name: "serviceItemDisplay",
label: "服务项目",
},
]; ];
...@@ -52,3 +52,13 @@ export const inventoryTypeList = [ ...@@ -52,3 +52,13 @@ export const inventoryTypeList = [
confValue: "虚拟", confValue: "虚拟",
}, },
]; ];
export const productCostTypeList = [
{
confId: 0,
confValue: "自定义成本",
},
{
confId: 1,
confValue: "默认带入产品成本",
},
];
export { default as relateStoreDialog } from "./components/relateStoreDialog.vue"; export { default as relateStoreDialog } from "./components/relateStoreDialog.vue";
export { default as relateStoreTable } from "./components/relateStoreTable.vue"; export { default as relateStoreTable } from "./components/relateStoreTable.vue";
export { crowdUpgradeSupplyModeList, packageGoodsDetail, packageGoodsForm, upgradeSupplyModeList } from "./constants/data"; export { crowdUpgradeSupplyModeList, packageGoodsDetail, packageGoodsForm, upgradeSupplyModeList } from "./constants/data";
export { financeCheckFlagList, inventoryTypeList, statusList } from "./constants/index"; export { financeCheckFlagList, inventoryTypeList, productCostTypeList, statusList } from "./constants/index";
export { default as merchantIcon } from "./images/merchant_icon.png"; export { default as merchantIcon } from "./images/merchant_icon.png";
export { default as pdfThumbnailPng } from "./images/PDF_thumbnail.png"; export { default as pdfThumbnailPng } from "./images/PDF_thumbnail.png";
export { default as photoThumbnailPng } from "./images/photo_thumbnail.png"; export { default as photoThumbnailPng } from "./images/photo_thumbnail.png";
......
import { baseConfig } from "@/main";
/** 太阳膜、改色膜、车衣 — 需展示服务项目 */
export const SERVICE_ITEM_GOODS_TYPES = [1, 12, 14];
export function isEquityOrExtended(goodsType) {
if (goodsType === "" || goodsType === null || goodsType === undefined) {
return false;
}
const equitySceneType = baseConfig.equitySceneType || [];
const extendedPosiType = baseConfig.extendedPosiType || [];
const type = Number(goodsType);
return equitySceneType.includes(type) || extendedPosiType.includes(type)
|| equitySceneType.includes(goodsType) || extendedPosiType.includes(goodsType);
}
export function isThirdPart(supplierCode) {
return (baseConfig.supplierCode || []).includes(`${supplierCode}`);
}
/** 自营延保 & 权益 */
export function isSelfOperatedEquityExtended(goodsType, supplierCode) {
return isEquityOrExtended(goodsType) && !isThirdPart(supplierCode);
}
/** 第三方延保 & 权益 */
export function isThirdPartyEquityExtended(goodsType, supplierCode) {
return isEquityOrExtended(goodsType) && isThirdPart(supplierCode);
}
/** 轻改类:非权益 & 非延保 */
export function isLightModification(goodsType) {
return goodsType !== "" && goodsType !== undefined && goodsType !== null && !isEquityOrExtended(goodsType);
}
export function shouldShowServiceItem(goodsType) {
if (goodsType === "" || goodsType === null || goodsType === undefined) {
return false;
}
return SERVICE_ITEM_GOODS_TYPES.includes(Number(goodsType));
}
/** 太阳膜、改色膜、车衣 — 需展示上架部位 */
export function shouldShowPosition(goodsType) {
return shouldShowServiceItem(goodsType);
}
/** 自营延保/权益不展示商品成本带入方式 */
export function shouldShowProductCostType(goodsType, supplierCode) {
return !!goodsType && !isSelfOperatedEquityExtended(goodsType, supplierCode);
}
/**
* 根据 query.cost 返回值填充成本字段
* 1、轻改:upgradeCost → 升级产品填产品升级成本;基础产品填赠送成本
* 2、权益延保自营:equityDjCost 由选产品旧逻辑处理,此处不改
* 3、权益延保第三方:equityOperationCost → 第三方成本;勾选基础产品时同时填赠送成本
*/
export function applyQueryCostResult(formData, costResult = {}, productType = []) {
const { goodsType, supplierCode } = formData;
const types = productType || [];
if (isLightModification(goodsType)) {
const upgradeCost = costResult.upgradeCost ?? "";
if (types.includes(2)) {
formData.upgradeProductCost = upgradeCost;
}
if (types.includes(1)) {
formData.giftCost = upgradeCost;
}
return;
}
// 自营延保/权益:沿用选产品时 djCost 旧逻辑,不在此填充
if (isSelfOperatedEquityExtended(goodsType, supplierCode)) {
return;
}
if (isThirdPartyEquityExtended(goodsType, supplierCode)) {
const equityOperationCost = costResult.equityOperationCost ?? "";
formData.thirdPartyCost = equityOperationCost;
if (types.includes(1)) {
formData.giftCost = equityOperationCost;
}
}
}
export function isAutoProductCostType(productCostType) {
return productCostType === 1 || productCostType === "1";
}
function isEmptyCost(value) {
return (value ?? "") === "";
}
/**
* 选择「默认带入产品成本」时,判断当前需填充的成本是否为空
*/
export function isAutoFillCostEmpty(formData, costResult = {}, productType = []) {
const { goodsType, supplierCode } = formData;
const types = productType || [];
if (isLightModification(goodsType)) {
if (!types.includes(1) && !types.includes(2)) {
return false;
}
return isEmptyCost(costResult.upgradeCost);
}
if (isThirdPartyEquityExtended(goodsType, supplierCode)) {
return isEmptyCost(costResult.equityOperationCost);
}
return false;
}
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<script> <script>
import { addOrUpdateAPI, checkGroundingLog, getMerchantGoodsInfo, getOperationCost } from "@api/grounding"; import { addOrUpdateAPI, checkGroundingLog, getMerchantGoodsInfo, getOperationCost } from "@api/grounding";
import { getList as getConstructionItemList } from "@api/serviceItemsManage";
import { getBaseSceneCodeList } from "@api/productManage"; import { getBaseSceneCodeList } from "@api/productManage";
import { mapActions } from "vuex"; import { mapActions } from "vuex";
import { BaseData } from "@/common/constants.js"; import { BaseData } from "@/common/constants.js";
...@@ -26,6 +27,7 @@ import { baseConfig } from "@/main"; ...@@ -26,6 +27,7 @@ import { baseConfig } from "@/main";
import { convertYuanToWan, filterSpecsStr } from "@/views/goods/filterOption"; import { convertYuanToWan, filterSpecsStr } from "@/views/goods/filterOption";
import groundingForm from "@/views/goods/grounding/components/groundingForm.vue"; import groundingForm from "@/views/goods/grounding/components/groundingForm.vue";
import { baseSupplyModeList, productList, upgradeSupplyModeList } from "@/views/goods/grounding/constants/data"; import { baseSupplyModeList, productList, upgradeSupplyModeList } from "@/views/goods/grounding/constants/data";
import { isSelfOperatedEquityExtended } from "@/views/goods/grounding/utils/productCost";
export default { export default {
name: "EditGrounding", name: "EditGrounding",
...@@ -130,6 +132,11 @@ export default { ...@@ -130,6 +132,11 @@ export default {
value: "operationCost", value: "operationCost",
type: "price", type: "price",
}, },
{
label: "采购成本/元",
value: "operationCost",
type: "price",
},
], ],
}, },
{ {
...@@ -140,6 +147,33 @@ export default { ...@@ -140,6 +147,33 @@ export default {
width: "432px", width: "432px",
}, },
{ {
name: "serviceItemId",
label: "服务项目",
type: "select",
isRequired: true,
isClear: false,
optionList: [],
optionId: "serviceItemId",
optionLabel: "serviceItemsName",
width: "432px",
},
{
name: "productCostType",
label: "商品成本带入方式",
type: "flagRadio",
isRequired: true,
radioGroupList: [
{
label: "默认带入产品成本",
value: 1,
},
{
label: "自定义成本",
value: 0,
},
],
},
{
name: "goodsAlias", name: "goodsAlias",
label: "商品别名", label: "商品别名",
type: "input", type: "input",
...@@ -307,6 +341,9 @@ export default { ...@@ -307,6 +341,9 @@ export default {
sellPriceValidType: 1, sellPriceValidType: 1,
tempValidDate: [], tempValidDate: [],
financeCheckFlag: "N", financeCheckFlag: "N",
serviceItemId: "",
productCostType: "",
warrantyType: 0,
}, },
secondGoodsList: [], secondGoodsList: [],
goodsNameKeyword: "", goodsNameKeyword: "",
...@@ -326,9 +363,9 @@ export default { ...@@ -326,9 +363,9 @@ export default {
}), }),
initData() { initData() {
// 获取业务场景数据 // 获取业务场景数据
getBaseSceneCodeList({ status: 1 }).then((res) => { getBaseSceneCodeList({ status: 1 }).then(async (res) => {
this.sceneCodeList = res || []; this.sceneCodeList = res || [];
this.getBaseData(); await this.getBaseData();
const id = this.$route.query.id; const id = this.$route.query.id;
if (!id) { if (!id) {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -341,6 +378,15 @@ export default { ...@@ -341,6 +378,15 @@ export default {
}); });
}, },
async getBaseData() { async getBaseData() {
const serviceItemRes = await getConstructionItemList({
categoryId: 1,
pageSize: 10000,
currentPage: 1,
});
const serviceItemList = (serviceItemRes?.list || []).map(item => ({
...item,
serviceItemId: item.serviceItemId ?? item.id,
}));
this.editForm.forEach((item) => { this.editForm.forEach((item) => {
item.formBlock && item.formBlock.forEach((v) => { item.formBlock && item.formBlock.forEach((v) => {
if (v.type == "check") { if (v.type == "check") {
...@@ -357,9 +403,13 @@ export default { ...@@ -357,9 +403,13 @@ export default {
if (v.name == "baseSceneCode") { // 业务场景 if (v.name == "baseSceneCode") { // 业务场景
v.optionList = this.sceneCodeList; v.optionList = this.sceneCodeList;
} }
if (v.name == "serviceItemId") {
v.optionList = serviceItemList;
}
}); });
}); });
this.positionTypeList = await this.get(BaseData.positionTypeList); this.positionTypeList = await this.get(BaseData.positionTypeList);
console.log(this.positionTypeList,'positionTypeList');
}, },
getDetailInfo(id) { getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(async (res) => { getMerchantGoodsInfo({ id }).then(async (res) => {
...@@ -392,6 +442,13 @@ export default { ...@@ -392,6 +442,13 @@ export default {
} }
} }
res.tempValidDate = tempValidDate; res.tempValidDate = tempValidDate;
if (res.warrantyType === null || res.warrantyType === undefined || res.warrantyType === "") {
res.warrantyType = 0;
}
// 自营延保/权益:编辑回显时 productCostType 固定为 1
if (isSelfOperatedEquityExtended(res.goodsType, res.supplierCode)) {
res.productCostType = 1;
}
res.upgradeGoods = { res.upgradeGoods = {
...res?.upgradeGoods, ...res?.upgradeGoods,
goodsName: res.goodsInfo.goodsName, goodsName: res.goodsInfo.goodsName,
...@@ -420,7 +477,6 @@ export default { ...@@ -420,7 +477,6 @@ export default {
return (data ?? "") === ""; return (data ?? "") === "";
}, },
handleAddClose() { handleAddClose() {
this.close({ tagName: "/grounding" });
this.$router.push({ name: "grounding" }); this.$router.push({ name: "grounding" });
this.close({ tagName: "/editGrounding" }); this.close({ tagName: "/editGrounding" });
}, },
...@@ -481,7 +537,11 @@ export default { ...@@ -481,7 +537,11 @@ export default {
}; };
if (params.tempValidDate) { if (params.tempValidDate) {
delete params.tempValidDate; delete params.tempValidDate;
}; }
// 自营延保/权益:沿用旧规则填嘀加成本,提交时 productCostType 固定传 1
if (isSelfOperatedEquityExtended(data.goodsType, data.supplierCode)) {
params.productCostType = 1;
}
if (data?.goodsType == 1 && !this.filterBaseSceneCodeBySceneType(1)?.includes(data?.baseSceneCode)) { if (data?.goodsType == 1 && !this.filterBaseSceneCodeBySceneType(1)?.includes(data?.baseSceneCode)) {
return this.$message.warning("太阳膜类产品仅支持上架至精品升级场景"); return this.$message.warning("太阳膜类产品仅支持上架至精品升级场景");
} }
...@@ -538,7 +598,7 @@ export default { ...@@ -538,7 +598,7 @@ export default {
const obj = { // 产品信息 const obj = { // 产品信息
position: "", position: "",
goodsAlias: "", goodsAlias: "",
warrantyType: "", warrantyType: 0,
productType: [], productType: [],
baseSupplyMode: "", baseSupplyMode: "",
upgradeSupplyMode: "", upgradeSupplyMode: "",
...@@ -551,6 +611,8 @@ export default { ...@@ -551,6 +611,8 @@ export default {
validMinSellPrice: "Y", validMinSellPrice: "Y",
djCost: "", djCost: "",
thirdPartyCost: "", thirdPartyCost: "",
serviceItemId: "",
productCostType: "",
}; };
addOrUpdateAPI(this.dealObjectValue(params)).then((res) => { addOrUpdateAPI(this.dealObjectValue(params)).then((res) => {
this.notice.okTips(); this.notice.okTips();
...@@ -578,18 +640,18 @@ export default { ...@@ -578,18 +640,18 @@ export default {
return param; return param;
}, },
handleClose(isRefresh = false) { handleClose(isRefresh = false) {
if (isRefresh) { const goBack = () => {
this.close({ tagName: "/grounding" });
this.$router.push({ name: "grounding" }); this.$router.push({ name: "grounding" });
this.close({ tagName: "/grounding" }); this.close({ tagName: "/editGrounding" });
};
if (isRefresh) {
goBack();
} else { } else {
this.$confirm("内容未保存,是否返回?", "提示", { this.$confirm("内容未保存,是否返回?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
type: "warning", type: "warning",
}).then(() => { }).then(() => {
this.close({ tagName: "/grounding" }); goBack();
this.$router.push({ name: "grounding" });
this.close({ tagName: "/grounding" });
}).catch((err) => { }).catch((err) => {
console.log(err); console.log(err);
}); });
......
...@@ -7,7 +7,7 @@ import { BaseData, sceneCodeList } from "@/common/constants.js"; ...@@ -7,7 +7,7 @@ import { BaseData, sceneCodeList } from "@/common/constants.js";
import { Util } from "@/common/util"; import { Util } from "@/common/util";
import store from "@/store"; import store from "@/store";
import { baseSupplyModeList, upgradeSupplyModeList } from "@/views/goods/grounding/constants/data"; import { baseSupplyModeList, upgradeSupplyModeList } from "@/views/goods/grounding/constants/data";
import { financeCheckFlagList, inventoryTypeList, sellPriceTempValidStatusList, statusList } from "@/views/goods/grounding/constants/index"; import { financeCheckFlagList, inventoryTypeList, productCostTypeList, sellPriceTempValidStatusList, statusList } from "@/views/goods/grounding/constants/index";
import { priceFilter } from "@/views/goods/grounding/utils/number"; import { priceFilter } from "@/views/goods/grounding/utils/number";
export async function getSearchFromSchema(_refreshTableFn) { export async function getSearchFromSchema(_refreshTableFn) {
...@@ -158,6 +158,15 @@ export async function getSearchFromSchema(_refreshTableFn) { ...@@ -158,6 +158,15 @@ export async function getSearchFromSchema(_refreshTableFn) {
name: "cityCodeList", name: "cityCodeList",
addHtml: "applicableAreaSelect", addHtml: "applicableAreaSelect",
}, },
{
label: "商品成本带入方式",
name: "productCostType",
type: "select",
optionList: cloneDeep(productCostTypeList),
optionId: "confId",
optionLabel: "confValue",
optionsName: "productCostTypeList",
},
]; ];
}; };
...@@ -377,6 +386,11 @@ export async function getTableSchema() { ...@@ -377,6 +386,11 @@ export async function getTableSchema() {
}, },
}, },
{ {
label: "商品成本带入方式",
prop: "productCostTypeStr",
width: "150",
},
{
label: "校验最低价", label: "校验最低价",
prop: "", prop: "",
addHtml: "validMinSellPrice", addHtml: "validMinSellPrice",
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="header"> <div class="header">
<d2-search ref="showSearch" <d2-search ref="showSearch"
class="show-search" class="show-search"
label-width="100px" label-width="140px"
:form-data="searchFormSchema" :form-data="searchFormSchema"
:search-form="searchForm"> :search-form="searchForm">
<template #goodsCascader> <template #goodsCascader>
...@@ -217,7 +217,8 @@ import merchantIcon from "@/views/goods/grounding/images/merchant_icon.png"; ...@@ -217,7 +217,8 @@ import merchantIcon from "@/views/goods/grounding/images/merchant_icon.png";
import { getSearchFromSchema, getTableSchema } from "./index.data.js"; import { getSearchFromSchema, getTableSchema } from "./index.data.js";
export default { export default {
name: "GroundingIndex", // 需与路由 name 一致,d2admin keep-alive include 按路由名匹配
name: "grounding",
components: { components: {
BatchCopyDialog: batchCopyDialog, BatchCopyDialog: batchCopyDialog,
BatchModifyInventoryDialog, BatchModifyInventoryDialog,
...@@ -225,6 +226,7 @@ export default { ...@@ -225,6 +226,7 @@ export default {
}, },
data() { data() {
return { return {
isFirstActivated: true,
loading: { loading: {
page: false, page: false,
}, },
...@@ -248,6 +250,7 @@ export default { ...@@ -248,6 +250,7 @@ export default {
goodsSource: 0, goodsSource: 0,
financeCheckFlag: "", financeCheckFlag: "",
inventoryType: "", inventoryType: "",
productCostType: "",
cityCodeList: [], cityCodeList: [],
}, },
tempGoodsType: [], tempGoodsType: [],
...@@ -308,6 +311,16 @@ export default { ...@@ -308,6 +311,16 @@ export default {
this.loading.page = false; this.loading.page = false;
} }
}, },
activated() {
// 首次进入由 mounted + d2-table 自动拉取;从编辑/查看返回时保留筛选并刷新列表
if (this.isFirstActivated) {
this.isFirstActivated = false;
return;
}
this.$nextTick(() => {
this.$refs.groundingIndexTable && this.$refs.groundingIndexTable.refreshTable(false, false);
});
},
methods: { methods: {
...mapActions({ ...mapActions({
get: "d2admin/base/get", get: "d2admin/base/get",
...@@ -445,6 +458,7 @@ export default { ...@@ -445,6 +458,7 @@ export default {
goodsSource: 0, goodsSource: 0,
financeCheckFlag: "", financeCheckFlag: "",
inventoryType: "", inventoryType: "",
productCostType: "",
}; };
this.tempGoodsType = []; this.tempGoodsType = [];
this.applicableAreas = []; this.applicableAreas = [];
......
This diff could not be displayed because it is too large.
...@@ -27,6 +27,7 @@ import { deepClone } from "@/common/util"; ...@@ -27,6 +27,7 @@ import { deepClone } from "@/common/util";
import { baseConfig } from "@/main"; import { baseConfig } from "@/main";
import { convertYuanToWan, filterSpecsStr } from "@/views/goods/filterOption"; import { convertYuanToWan, filterSpecsStr } from "@/views/goods/filterOption";
import { packageGoodsForm } from "@/views/goods/grounding/index.js"; import { packageGoodsForm } from "@/views/goods/grounding/index.js";
import { isSelfOperatedEquityExtended } from "@/views/goods/grounding/utils/productCost";
import PackageForm from "@/views/goods/packageManage/components/packageForm/index.vue"; import PackageForm from "@/views/goods/packageManage/components/packageForm/index.vue";
export default { export default {
...@@ -208,7 +209,7 @@ export default { ...@@ -208,7 +209,7 @@ export default {
position: "", // 上架部位 position: "", // 上架部位
sellPrice: "", // 参考售价 sellPrice: "", // 参考售价
minSellPrice: "", // 最低售价 minSellPrice: "", // 最低售价
warrantyType: "", // 质保卡类型 warrantyType: 0, // 质保卡类型,默认质保卡
upgradeSupplyMode: "", // 升级产品供货模式 upgradeSupplyMode: "", // 升级产品供货模式
upgradeProductCost: "", // 升级产品成本 upgradeProductCost: "", // 升级产品成本
recoveryCost: "", // 回收成本 recoveryCost: "", // 回收成本
...@@ -216,6 +217,8 @@ export default { ...@@ -216,6 +217,8 @@ export default {
djCost: "", // 嘀加成本 djCost: "", // 嘀加成本
thirdPartyCost: "", // 第三方成本 thirdPartyCost: "", // 第三方成本
validMinSellPriceFlag: false, // 是否校验最低价 validMinSellPriceFlag: false, // 是否校验最低价
serviceItemId: "", // 服务项目
productCostType: "", // 商品成本带入方式,不默认选中
}, },
], ],
voucherList: [], // 上架凭证 voucherList: [], // 上架凭证
...@@ -287,13 +290,26 @@ export default { ...@@ -287,13 +290,26 @@ export default {
minSellPrice: val?.minSellPrice, // 最低售价 minSellPrice: val?.minSellPrice, // 最低售价
validMinSellPriceFlag: val?.validMinSellPrice === "Y", // 是否校验最低价 validMinSellPriceFlag: val?.validMinSellPrice === "Y", // 是否校验最低价
warrantyPeriod: val?.upgradeGoods?.warrantyPeriod, // 质保年限 warrantyPeriod: val?.upgradeGoods?.warrantyPeriod, // 质保年限
warrantyType: val?.warrantyType, // 质保卡类型 warrantyType: val?.warrantyType === "" || val?.warrantyType === null || val?.warrantyType === undefined
? 0
: val?.warrantyType, // 质保卡类型,默认质保卡
upgradeSupplyMode: val?.upgradeSupplyMode, // 升级、产品供货模式 upgradeSupplyMode: val?.upgradeSupplyMode, // 升级、产品供货模式
upgradeProductCost: val?.upgradeProductCost, // 升级产品成本 upgradeProductCost: val?.upgradeProductCost, // 升级产品成本
recoveryCost: val?.recoveryCost, // 回收成本 recoveryCost: val?.recoveryCost, // 回收成本
virtualAccountCost: val?.virtualAccountCost, // 虚拟对账成本 virtualAccountCost: val?.virtualAccountCost, // 虚拟对账成本
djCost: val?.djCost, // 嘀加成本 djCost: val?.djCost, // 嘀加成本
thirdPartyCost: val?.thirdPartyCost, // 第三方成本 thirdPartyCost: val?.thirdPartyCost, // 第三方成本
serviceItemId: val?.serviceItemId ?? "", // 服务项目
productCostType: (() => {
const supplierCode = val?.goodsInfo?.supplierCode;
// 自营延保/权益:编辑回显时 productCostType 固定为 1
if (isSelfOperatedEquityExtended(val?.goodsType, supplierCode)) {
return 1;
}
return val?.productCostType === 0 || val?.productCostType === 1 || val?.productCostType === "0" || val?.productCostType === "1"
? Number(val.productCostType)
: "";
})(), // 商品成本带入方式
supplierCode: val?.goodsInfo?.supplierCode, // 供应方 supplierCode: val?.goodsInfo?.supplierCode, // 供应方
upgradeGoods: { upgradeGoods: {
...val?.upgradeGoods, ...val?.upgradeGoods,
...@@ -331,7 +347,6 @@ export default { ...@@ -331,7 +347,6 @@ export default {
this.show = true; this.show = true;
}, },
handleAddClose() { handleAddClose() {
this.close({ tagName: "/packageManage" });
this.$router.push({ name: "packageManage" }); this.$router.push({ name: "packageManage" });
this.close({ tagName: "/editPackage" }); this.close({ tagName: "/editPackage" });
}, },
...@@ -395,7 +410,7 @@ export default { ...@@ -395,7 +410,7 @@ export default {
}); });
const merchantGoodsInfoList = []; const merchantGoodsInfoList = [];
data?.groundingGoodsList?.forEach((val) => { // 套餐产品数据处理 data?.groundingGoodsList?.forEach((val) => { // 套餐产品数据处理
merchantGoodsInfoList.push({ const item = {
id: val.id, id: val.id,
upgradeGoodsId: val.upgradeGoodsId, upgradeGoodsId: val.upgradeGoodsId,
position: val?.position || undefined, position: val?.position || undefined,
...@@ -413,7 +428,16 @@ export default { ...@@ -413,7 +428,16 @@ export default {
recoveryCost: val?.recoveryCost, // 回收成本 recoveryCost: val?.recoveryCost, // 回收成本
upgradeSupplyMode: val?.upgradeSupplyMode || "", // 升级产品供货模式 upgradeSupplyMode: val?.upgradeSupplyMode || "", // 升级产品供货模式
warrantyType: val?.warrantyType, // 质保卡类型 warrantyType: val?.warrantyType, // 质保卡类型
}); serviceItemId: val?.serviceItemId || undefined, // 服务项目 id
productCostType: val?.productCostType === 0 || val?.productCostType === 1 || val?.productCostType === "0" || val?.productCostType === "1"
? Number(val.productCostType)
: undefined, // 0-自定义成本 1-默认带入产品成本
};
// 自营延保/权益:沿用旧规则填嘀加成本,提交时 productCostType 固定传 1
if (isSelfOperatedEquityExtended(val?.goodsType, val?.supplierCode)) {
item.productCostType = 1;
}
merchantGoodsInfoList.push(item);
}); });
// 整理上传凭证数据 // 整理上传凭证数据
const params = { const params = {
...@@ -519,18 +543,18 @@ export default { ...@@ -519,18 +543,18 @@ export default {
return param; return param;
}, },
handleClose(isRefresh = false) { handleClose(isRefresh = false) {
if (isRefresh) { const goBack = () => {
this.close({ tagName: "/packageManage" });
this.$router.push({ name: "packageManage" }); this.$router.push({ name: "packageManage" });
this.close({ tagName: "/packageManage" }); this.close({ tagName: "/editPackage" });
};
if (isRefresh) {
goBack();
} else { } else {
this.$confirm("内容未保存,是否返回?", "提示", { this.$confirm("内容未保存,是否返回?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
type: "warning", type: "warning",
}).then(() => { }).then(() => {
this.close({ tagName: "/packageManage" }); goBack();
this.$router.push({ name: "packageManage" });
this.close({ tagName: "/packageManage" });
}).catch((err) => { }).catch((err) => {
console.log(err); console.log(err);
}); });
......
...@@ -3,7 +3,7 @@ import { getParkStore } from "@api/editCustomer"; ...@@ -3,7 +3,7 @@ import { getParkStore } from "@api/editCustomer";
import { getAreaDataList, getBaseSceneCodeList } from "@api/productManage"; import { getAreaDataList, getBaseSceneCodeList } from "@api/productManage";
import { cloneDeep, isFunction } from "lodash-es"; import { cloneDeep, isFunction } from "lodash-es";
import { Util } from "@/common/util"; import { Util } from "@/common/util";
import { financeCheckFlagList, inventoryTypeList, priceFilter, statusList } from "@/views/goods/grounding"; import { financeCheckFlagList, inventoryTypeList, priceFilter, productCostTypeList, statusList } from "@/views/goods/grounding";
export async function getSearchFormSchema(_refreshTable) { export async function getSearchFormSchema(_refreshTable) {
const refreshTable = isFunction(_refreshTable) ? _refreshTable : () => {}; const refreshTable = isFunction(_refreshTable) ? _refreshTable : () => {};
...@@ -98,6 +98,39 @@ export async function getSearchFormSchema(_refreshTable) { ...@@ -98,6 +98,39 @@ export async function getSearchFormSchema(_refreshTable) {
name: "applicableArea", name: "applicableArea",
addHtml: "applicableAreaSelect", addHtml: "applicableAreaSelect",
}, },
{
label: "商品成本带入方式",
name: "productCostType",
type: "select",
optionList: cloneDeep(productCostTypeList),
optionId: "confId",
optionLabel: "confValue",
optionsName: "productCostTypeList",
},
{
label: "产品ID",
name: "productId",
maxlength: "50",
type: "input",
isClear: true,
keyFn: refreshTable,
},
{
label: "产品名称",
name: "productName",
maxlength: "50",
type: "input",
isClear: true,
keyFn: refreshTable,
},
{
label: "产品编码",
name: "productCode",
maxlength: "50",
type: "input",
isClear: true,
keyFn: refreshTable,
},
]; ];
} }
...@@ -197,6 +230,12 @@ export async function getTableColumnsSchema() { ...@@ -197,6 +230,12 @@ export async function getTableColumnsSchema() {
}, },
}, },
{ {
label: "商品成本带入方式",
prop: "productCostTypeStr",
width: "150",
},
{
label: "上架门店", label: "上架门店",
name: "", name: "",
type: "slot", type: "slot",
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<d2-search v-if="searchFormSchema.length" <d2-search v-if="searchFormSchema.length"
ref="showSearch" ref="showSearch"
class="show-search" class="show-search"
label-width="100px" label-width="140px"
:form-data="searchFormSchema" :form-data="searchFormSchema"
:search-form="searchForm"> :search-form="searchForm">
<template #matchPackageCode> <template #matchPackageCode>
...@@ -173,7 +173,8 @@ import BatchModifyPackageInventoryDialog from "@/views/goods/packageManage/compo ...@@ -173,7 +173,8 @@ import BatchModifyPackageInventoryDialog from "@/views/goods/packageManage/compo
import { getSearchFormSchema, getTableColumnsSchema } from "./index.data.js"; import { getSearchFormSchema, getTableColumnsSchema } from "./index.data.js";
export default { export default {
name: "PackageManage", // 需与路由 name 一致,d2admin keep-alive include 按路由名匹配
name: "packageManage",
components: { components: {
// ApplicableAreaSelect, // ApplicableAreaSelect,
BatchModifyPackageInventoryDialog, BatchModifyPackageInventoryDialog,
...@@ -181,6 +182,7 @@ export default { ...@@ -181,6 +182,7 @@ export default {
}, },
data() { data() {
return { return {
isFirstActivated: true,
images: { images: {
merchantIcon, merchantIcon,
}, },
...@@ -200,6 +202,10 @@ export default { ...@@ -200,6 +202,10 @@ export default {
goodsSource: 0, goodsSource: 0,
financeCheckFlag: "", financeCheckFlag: "",
inventoryType: "", inventoryType: "",
productCostType: "",
productId: "",
productName: "",
productCode: "",
}, },
getListApi: getPackageManageList, getListApi: getPackageManageList,
searchFormSchema: [], searchFormSchema: [],
...@@ -238,6 +244,16 @@ export default { ...@@ -238,6 +244,16 @@ export default {
this.loading.page = false; this.loading.page = false;
} }
}, },
activated() {
// 首次进入由 mounted + d2-table 自动拉取;从编辑/查看返回时保留筛选并刷新列表
if (this.isFirstActivated) {
this.isFirstActivated = false;
return;
}
this.$nextTick(() => {
this.$refs.packageIndexTable && this.$refs.packageIndexTable.refreshTable(false, false);
});
},
methods: { methods: {
...mapActions({ ...mapActions({
get: "d2admin/base/get", get: "d2admin/base/get",
...@@ -273,6 +289,10 @@ export default { ...@@ -273,6 +289,10 @@ export default {
goodsSource: 0, goodsSource: 0,
financeCheckFlag: "", financeCheckFlag: "",
inventoryType: "", inventoryType: "",
productCostType: "",
productId: "",
productName: "",
productCode: "",
}; };
this.applicableAreas = []; this.applicableAreas = [];
// 重新查询 // 重新查询
......
...@@ -168,7 +168,6 @@ export default { ...@@ -168,7 +168,6 @@ export default {
}, },
metricName(item) { metricName(item) {
let { metricConfigs } = this let { metricConfigs } = this
console.log(metricConfigs)
if (metricConfigs && metricConfigs.length) return metricConfigs.find(e => e.metricCode == item.guaranteeIndex)?.metricName || '-' if (metricConfigs && metricConfigs.length) return metricConfigs.find(e => e.metricCode == item.guaranteeIndex)?.metricName || '-'
return '-' return '-'
}, },
...@@ -176,7 +175,6 @@ export default { ...@@ -176,7 +175,6 @@ export default {
return JSON.parse(data) return JSON.parse(data)
}, },
formatGuaranteeItem(i, item) { formatGuaranteeItem(i, item) {
console.log(i)
let unit = i.unit || '' let unit = i.unit || ''
return `满足${i.startValue}${unit} &le; ${this.metricName(item)}&lt;${i.endValue}${unit}时,差距订单数每单赔付${i.compensationAmount}元` return `满足${i.startValue}${unit} &le; ${this.metricName(item)}&lt;${i.endValue}${unit}时,差距订单数每单赔付${i.compensationAmount}元`
} }
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
</el-select> </el-select>
</template> </template>
<template v-else-if="i.type == 'radio'"> <template v-else-if="i.type == 'radio'">
<el-radio-group v-model="componentData[i.key]" :disabled="disabled(componentData.guaranteeIndex)"> <el-radio-group v-model="componentData[i.key]" :disabled="disabled(componentData.guaranteeIndex)"
@change="radioChange">
<template v-for="r in i.options"> <template v-for="r in i.options">
<el-radio :key="r.value" :label="r.value">{{ r.label }}</el-radio> <el-radio :key="r.value" :label="r.value">{{ r.label }}</el-radio>
</template> </template>
...@@ -145,6 +146,7 @@ export default { ...@@ -145,6 +146,7 @@ export default {
this.selectionChange(val.guaranteeIndex, false) this.selectionChange(val.guaranteeIndex, false)
if (val.ladderConditions) this.ladderConditions = JSON.parse(val.ladderConditions) if (val.ladderConditions) this.ladderConditions = JSON.parse(val.ladderConditions)
} }
this.formRef && this.formRef.clearValidate()
}, },
deep: true, deep: true,
immediate: true immediate: true
...@@ -164,22 +166,6 @@ export default { ...@@ -164,22 +166,6 @@ export default {
}, },
deep: true deep: true
}, },
'componentData.compensationMode': {
handler(val) {
if (val == 2) {
this.ladderConditions = [{
startValue: '',
endValue: '',
compensationAmount: ''
}, {
startValue: '',
endValue: '',
compensationAmount: ''
}]
} else this.ladderConditions = []
if (val == 1 && this.componentData.fixedCompensation) this.componentData.fixedCompensation = ''
}
},
}, },
computed: { computed: {
...@@ -206,7 +192,20 @@ export default { ...@@ -206,7 +192,20 @@ export default {
}, },
mounted() { }, mounted() { },
methods: { methods: {
radioChange(val) {
if (val == 2) {
this.ladderConditions = [{
startValue: '',
endValue: '',
compensationAmount: ''
}, {
startValue: '',
endValue: '',
compensationAmount: ''
}]
} else this.ladderConditions = []
if (val == 1 && this.componentData.fixedCompensation) this.componentData.fixedCompensation = ''
},
selectionChange(val, clear = true) { selectionChange(val, clear = true) {
let item = this.conditionForm[1], let item = this.conditionForm[1],
{ conditionStartConfig, conditionEndConfig } = this, { conditionStartConfig, conditionEndConfig } = this,
......
...@@ -133,7 +133,6 @@ export default { ...@@ -133,7 +133,6 @@ export default {
data: { data: {
handler(newVal) { handler(newVal) {
this.componentData = deepClone(newVal) this.componentData = deepClone(newVal)
console.log(JSON.parse(JSON.stringify(newVal)))
this.$nextTick(() => { this.$nextTick(() => {
this.formRef.clearValidate() this.formRef.clearValidate()
}) })
......
...@@ -224,7 +224,6 @@ export default { ...@@ -224,7 +224,6 @@ export default {
}) })
} }
if (item.hasGuarantee == 1) { if (item.hasGuarantee == 1) {
console.log('item.guaranteeConfigs', item.guaranteeConfigs)
if (item.guaranteeConfigs && item.guaranteeConfigs.length) { if (item.guaranteeConfigs && item.guaranteeConfigs.length) {
item.guaranteeConfigs.forEach((c, num) => { item.guaranteeConfigs.forEach((c, num) => {
if (c.guaranteeStandard == null || c.guaranteeIndex == '') { if (c.guaranteeStandard == null || c.guaranteeIndex == '') {
...@@ -256,7 +255,6 @@ export default { ...@@ -256,7 +255,6 @@ export default {
params.trafficPartyDetails = i.trafficPartyDetails params.trafficPartyDetails = i.trafficPartyDetails
sceneConfigs.push(params) sceneConfigs.push(params)
}) })
console.log(sceneConfigs)
if (flag) callback(true, { sceneConfigs }) if (flag) callback(true, { sceneConfigs })
else callback(false, message) else callback(false, message)
} else callback(false) } else callback(false)
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<template v-if="pageComplete"> <template v-if="pageComplete">
<el-button v-if="pageType == 'audit' && step == 4" type="primary" @click="rejectDialogVisible = true" <el-button v-if="pageType == 'audit' && step == 4" type="primary" @click="rejectDialogVisible = true"
plain>驳回</el-button> plain>驳回</el-button>
<el-button v-if="pageType == 'edit' && step == 3" type="primary" @click="prevStep" plain>上一步</el-button>
<el-button v-if="pageType != 'view'" @click="submit" :loading="buttonLoading" type="primary">{{ submitText <el-button v-if="pageType != 'view'" @click="submit" :loading="buttonLoading" type="primary">{{ submitText
}}</el-button> }}</el-button>
</template> </template>
...@@ -208,10 +209,15 @@ export default { ...@@ -208,10 +209,15 @@ export default {
} }
}, },
methods: { methods: {
async getDetail(businessCode, pageType) { prevStep() {
let { businessCode, pageType, step } = this
this.getDetail(businessCode, pageType, true, step)
},
async getDetail(businessCode, pageType, isPrevStep, STEP) {
const data = await storeApproveQueryDetail({ businessCode }), const data = await storeApproveQueryDetail({ businessCode }),
{ basicApproveInfo, trafficPartyConfigs, operateLogs, shelfType, updStep } = data, { basicApproveInfo, trafficPartyConfigs, operateLogs, shelfType, updStep } = data,
step = updStep ? updStep + 1 : 2 // step = 2
step = isPrevStep ? STEP - 1 : (updStep ? updStep + 1 : 2)
this.basicinformationData = data this.basicinformationData = data
let basicinformationFormList = JSON.parse(basicApproveInfo) let basicinformationFormList = JSON.parse(basicApproveInfo)
if (pageType != 'reapply') { if (pageType != 'reapply') {
...@@ -363,7 +369,6 @@ export default { ...@@ -363,7 +369,6 @@ export default {
} }
} else throw message } else throw message
} catch (error) { } catch (error) {
console.log(error)
this.dialogVisible = false this.dialogVisible = false
this.buttonLoading = false this.buttonLoading = false
setTimeout(() => { setTimeout(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!