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) {
data.method = 'dj.api.smartcarlife.merchantGoodsInfo.operationCost.calculate'
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) {
data.method = `${path}productManager.listUpgradeGoodsWithPage`;
return request(data, "post");
}
export function getUpgradeProductListV2(data) {
data.method = `dj.api.smartcarlife.productManager.listUpgradeGoodsWithPage.v2`;
return request(data, "post");
}
// 根据id查询商品详情
export function getBaseGoodsById(data) {
......
......@@ -5,34 +5,34 @@
const API_NAME_MAPPING = {
"dj.smartcarlife": "axios",
dj: "axios",
scrm: "axios2",
merchants: "axios3",
reportExport: "axios4",
"dj": "axios",
"scrm": "axios2",
"merchants": "axios3",
"reportExport": "axios4",
"glsx.accounts.biz.common.pictureUpload": "common",
clue: "axios5",
"clue": "axios5",
"dj.businessSchool": "axios6",
script: "axios7",
staff: "axios9",
riskmanage: "axios10",
strategy: "axios_strategy",
supervisor: "axios_supervisor",
oaapproval: "axios_oaapproval",
taskcenter: "axiosTaskCenter",
"script": "axios7",
"staff": "axios9",
"riskmanage": "axios10",
"strategy": "axios_strategy",
"supervisor": "axios_supervisor",
"oaapproval": "axios_oaapproval",
"taskcenter": "axiosTaskCenter",
};
const SIGN_WAY = {
"dj.smartcarlife": "sha1",
dj: "sha1",
scrm: "sha1",
glsx: "md5",
"dj": "sha1",
"scrm": "sha1",
"glsx": "md5",
"glsx.accounts.biz.common.pictureUpload": "md5",
clue: "sha1",
script: "sha1",
staff: "sha1",
riskmanage: "sha1",
oaapproval: "sha1",
taskcenter: "sha1",
"clue": "sha1",
"script": "sha1",
"staff": "sha1",
"riskmanage": "sha1",
"oaapproval": "sha1",
"taskcenter": "sha1",
};
/**
......@@ -77,7 +77,7 @@ function resolveApiName(method = "") {
if (method.includes("dj.api.taskcenter")) {
return "taskcenter";
}
if (method.includes("merchants.api.open.createMerchantWithPermissions")) {
if (method.includes("merchants.api.open.createMerchantWithPermissions") || method.includes("merchants.api.oaapproval")) {
return "oaapproval";
}
if (method.includes("dj.api.marketing")) {
......
......@@ -189,7 +189,7 @@ export const routerName = {
title: "上架管理",
authId: "90309",
parentId: "903",
cache: false,
cache: true,
},
auth: [
{
......@@ -424,7 +424,7 @@ export const routerName = {
title: "套餐管理",
authId: "90312",
parentId: "903",
cache: false,
cache: true,
},
auth: [
{
......
This diff could not be displayed because it is too large.
......@@ -112,6 +112,12 @@ export const packageGoodsForm = [
type: "price",
isPrice: true,
},
{
label: "采购成本/元",
value: "purchaseCost",
type: "price",
isPrice: true,
},
],
},
{
......@@ -122,6 +128,33 @@ export const packageGoodsForm = [
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",
label: "商品别名",
type: "input",
......@@ -263,6 +296,11 @@ export const packageGoodsDetail = [
value: "operationCost",
type: "price",
},
{
label: "采购成本/元",
value: "purchaseCost",
type: "price",
},
],
},
{
......@@ -316,4 +354,12 @@ export const packageGoodsDetail = [
label: "第三方成本",
unit: true,
},
{
name: "productCostTypeStr",
label: "商品成本带入方式",
},
{
name: "serviceItemDisplay",
label: "服务项目",
},
];
......@@ -52,3 +52,13 @@ export const inventoryTypeList = [
confValue: "虚拟",
},
];
export const productCostTypeList = [
{
confId: 0,
confValue: "自定义成本",
},
{
confId: 1,
confValue: "默认带入产品成本",
},
];
export { default as relateStoreDialog } from "./components/relateStoreDialog.vue";
export { default as relateStoreTable } from "./components/relateStoreTable.vue";
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 pdfThumbnailPng } from "./images/PDF_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 @@
<script>
import { addOrUpdateAPI, checkGroundingLog, getMerchantGoodsInfo, getOperationCost } from "@api/grounding";
import { getList as getConstructionItemList } from "@api/serviceItemsManage";
import { getBaseSceneCodeList } from "@api/productManage";
import { mapActions } from "vuex";
import { BaseData } from "@/common/constants.js";
......@@ -26,6 +27,7 @@ import { baseConfig } from "@/main";
import { convertYuanToWan, filterSpecsStr } from "@/views/goods/filterOption";
import groundingForm from "@/views/goods/grounding/components/groundingForm.vue";
import { baseSupplyModeList, productList, upgradeSupplyModeList } from "@/views/goods/grounding/constants/data";
import { isSelfOperatedEquityExtended } from "@/views/goods/grounding/utils/productCost";
export default {
name: "EditGrounding",
......@@ -130,6 +132,11 @@ export default {
value: "operationCost",
type: "price",
},
{
label: "采购成本/元",
value: "operationCost",
type: "price",
},
],
},
{
......@@ -140,6 +147,33 @@ export default {
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",
label: "商品别名",
type: "input",
......@@ -307,6 +341,9 @@ export default {
sellPriceValidType: 1,
tempValidDate: [],
financeCheckFlag: "N",
serviceItemId: "",
productCostType: "",
warrantyType: 0,
},
secondGoodsList: [],
goodsNameKeyword: "",
......@@ -326,9 +363,9 @@ export default {
}),
initData() {
// 获取业务场景数据
getBaseSceneCodeList({ status: 1 }).then((res) => {
getBaseSceneCodeList({ status: 1 }).then(async (res) => {
this.sceneCodeList = res || [];
this.getBaseData();
await this.getBaseData();
const id = this.$route.query.id;
if (!id) {
this.$nextTick(() => {
......@@ -341,6 +378,15 @@ export default {
});
},
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) => {
item.formBlock && item.formBlock.forEach((v) => {
if (v.type == "check") {
......@@ -357,9 +403,13 @@ export default {
if (v.name == "baseSceneCode") { // 业务场景
v.optionList = this.sceneCodeList;
}
if (v.name == "serviceItemId") {
v.optionList = serviceItemList;
}
});
});
this.positionTypeList = await this.get(BaseData.positionTypeList);
console.log(this.positionTypeList,'positionTypeList');
},
getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(async (res) => {
......@@ -392,6 +442,13 @@ export default {
}
}
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,
goodsName: res.goodsInfo.goodsName,
......@@ -420,7 +477,6 @@ export default {
return (data ?? "") === "";
},
handleAddClose() {
this.close({ tagName: "/grounding" });
this.$router.push({ name: "grounding" });
this.close({ tagName: "/editGrounding" });
},
......@@ -481,7 +537,11 @@ export default {
};
if (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)) {
return this.$message.warning("太阳膜类产品仅支持上架至精品升级场景");
}
......@@ -538,7 +598,7 @@ export default {
const obj = { // 产品信息
position: "",
goodsAlias: "",
warrantyType: "",
warrantyType: 0,
productType: [],
baseSupplyMode: "",
upgradeSupplyMode: "",
......@@ -551,6 +611,8 @@ export default {
validMinSellPrice: "Y",
djCost: "",
thirdPartyCost: "",
serviceItemId: "",
productCostType: "",
};
addOrUpdateAPI(this.dealObjectValue(params)).then((res) => {
this.notice.okTips();
......@@ -578,18 +640,18 @@ export default {
return param;
},
handleClose(isRefresh = false) {
if (isRefresh) {
this.close({ tagName: "/grounding" });
const goBack = () => {
this.$router.push({ name: "grounding" });
this.close({ tagName: "/grounding" });
this.close({ tagName: "/editGrounding" });
};
if (isRefresh) {
goBack();
} else {
this.$confirm("内容未保存,是否返回?", "提示", {
confirmButtonText: "确定",
type: "warning",
}).then(() => {
this.close({ tagName: "/grounding" });
this.$router.push({ name: "grounding" });
this.close({ tagName: "/grounding" });
goBack();
}).catch((err) => {
console.log(err);
});
......
......@@ -7,7 +7,7 @@ import { BaseData, sceneCodeList } from "@/common/constants.js";
import { Util } from "@/common/util";
import store from "@/store";
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";
export async function getSearchFromSchema(_refreshTableFn) {
......@@ -158,6 +158,15 @@ export async function getSearchFromSchema(_refreshTableFn) {
name: "cityCodeList",
addHtml: "applicableAreaSelect",
},
{
label: "商品成本带入方式",
name: "productCostType",
type: "select",
optionList: cloneDeep(productCostTypeList),
optionId: "confId",
optionLabel: "confValue",
optionsName: "productCostTypeList",
},
];
};
......@@ -377,6 +386,11 @@ export async function getTableSchema() {
},
},
{
label: "商品成本带入方式",
prop: "productCostTypeStr",
width: "150",
},
{
label: "校验最低价",
prop: "",
addHtml: "validMinSellPrice",
......
......@@ -5,7 +5,7 @@
<div class="header">
<d2-search ref="showSearch"
class="show-search"
label-width="100px"
label-width="140px"
:form-data="searchFormSchema"
:search-form="searchForm">
<template #goodsCascader>
......@@ -217,7 +217,8 @@ import merchantIcon from "@/views/goods/grounding/images/merchant_icon.png";
import { getSearchFromSchema, getTableSchema } from "./index.data.js";
export default {
name: "GroundingIndex",
// 需与路由 name 一致,d2admin keep-alive include 按路由名匹配
name: "grounding",
components: {
BatchCopyDialog: batchCopyDialog,
BatchModifyInventoryDialog,
......@@ -225,6 +226,7 @@ export default {
},
data() {
return {
isFirstActivated: true,
loading: {
page: false,
},
......@@ -248,6 +250,7 @@ export default {
goodsSource: 0,
financeCheckFlag: "",
inventoryType: "",
productCostType: "",
cityCodeList: [],
},
tempGoodsType: [],
......@@ -308,6 +311,16 @@ export default {
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: {
...mapActions({
get: "d2admin/base/get",
......@@ -445,6 +458,7 @@ export default {
goodsSource: 0,
financeCheckFlag: "",
inventoryType: "",
productCostType: "",
};
this.tempGoodsType = [];
this.applicableAreas = [];
......
This diff could not be displayed because it is too large.
......@@ -27,6 +27,7 @@ import { deepClone } from "@/common/util";
import { baseConfig } from "@/main";
import { convertYuanToWan, filterSpecsStr } from "@/views/goods/filterOption";
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";
export default {
......@@ -208,7 +209,7 @@ export default {
position: "", // 上架部位
sellPrice: "", // 参考售价
minSellPrice: "", // 最低售价
warrantyType: "", // 质保卡类型
warrantyType: 0, // 质保卡类型,默认质保卡
upgradeSupplyMode: "", // 升级产品供货模式
upgradeProductCost: "", // 升级产品成本
recoveryCost: "", // 回收成本
......@@ -216,6 +217,8 @@ export default {
djCost: "", // 嘀加成本
thirdPartyCost: "", // 第三方成本
validMinSellPriceFlag: false, // 是否校验最低价
serviceItemId: "", // 服务项目
productCostType: "", // 商品成本带入方式,不默认选中
},
],
voucherList: [], // 上架凭证
......@@ -287,13 +290,26 @@ export default {
minSellPrice: val?.minSellPrice, // 最低售价
validMinSellPriceFlag: val?.validMinSellPrice === "Y", // 是否校验最低价
warrantyPeriod: val?.upgradeGoods?.warrantyPeriod, // 质保年限
warrantyType: val?.warrantyType, // 质保卡类型
warrantyType: val?.warrantyType === "" || val?.warrantyType === null || val?.warrantyType === undefined
? 0
: val?.warrantyType, // 质保卡类型,默认质保卡
upgradeSupplyMode: val?.upgradeSupplyMode, // 升级、产品供货模式
upgradeProductCost: val?.upgradeProductCost, // 升级产品成本
recoveryCost: val?.recoveryCost, // 回收成本
virtualAccountCost: val?.virtualAccountCost, // 虚拟对账成本
djCost: val?.djCost, // 嘀加成本
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, // 供应方
upgradeGoods: {
...val?.upgradeGoods,
......@@ -331,7 +347,6 @@ export default {
this.show = true;
},
handleAddClose() {
this.close({ tagName: "/packageManage" });
this.$router.push({ name: "packageManage" });
this.close({ tagName: "/editPackage" });
},
......@@ -395,7 +410,7 @@ export default {
});
const merchantGoodsInfoList = [];
data?.groundingGoodsList?.forEach((val) => { // 套餐产品数据处理
merchantGoodsInfoList.push({
const item = {
id: val.id,
upgradeGoodsId: val.upgradeGoodsId,
position: val?.position || undefined,
......@@ -413,7 +428,16 @@ export default {
recoveryCost: val?.recoveryCost, // 回收成本
upgradeSupplyMode: val?.upgradeSupplyMode || "", // 升级产品供货模式
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 = {
......@@ -519,18 +543,18 @@ export default {
return param;
},
handleClose(isRefresh = false) {
if (isRefresh) {
this.close({ tagName: "/packageManage" });
const goBack = () => {
this.$router.push({ name: "packageManage" });
this.close({ tagName: "/packageManage" });
this.close({ tagName: "/editPackage" });
};
if (isRefresh) {
goBack();
} else {
this.$confirm("内容未保存,是否返回?", "提示", {
confirmButtonText: "确定",
type: "warning",
}).then(() => {
this.close({ tagName: "/packageManage" });
this.$router.push({ name: "packageManage" });
this.close({ tagName: "/packageManage" });
goBack();
}).catch((err) => {
console.log(err);
});
......
......@@ -3,7 +3,7 @@ import { getParkStore } from "@api/editCustomer";
import { getAreaDataList, getBaseSceneCodeList } from "@api/productManage";
import { cloneDeep, isFunction } from "lodash-es";
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) {
const refreshTable = isFunction(_refreshTable) ? _refreshTable : () => {};
......@@ -98,6 +98,39 @@ export async function getSearchFormSchema(_refreshTable) {
name: "applicableArea",
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() {
},
},
{
label: "商品成本带入方式",
prop: "productCostTypeStr",
width: "150",
},
{
label: "上架门店",
name: "",
type: "slot",
......
......@@ -6,7 +6,7 @@
<d2-search v-if="searchFormSchema.length"
ref="showSearch"
class="show-search"
label-width="100px"
label-width="140px"
:form-data="searchFormSchema"
:search-form="searchForm">
<template #matchPackageCode>
......@@ -173,7 +173,8 @@ import BatchModifyPackageInventoryDialog from "@/views/goods/packageManage/compo
import { getSearchFormSchema, getTableColumnsSchema } from "./index.data.js";
export default {
name: "PackageManage",
// 需与路由 name 一致,d2admin keep-alive include 按路由名匹配
name: "packageManage",
components: {
// ApplicableAreaSelect,
BatchModifyPackageInventoryDialog,
......@@ -181,6 +182,7 @@ export default {
},
data() {
return {
isFirstActivated: true,
images: {
merchantIcon,
},
......@@ -200,6 +202,10 @@ export default {
goodsSource: 0,
financeCheckFlag: "",
inventoryType: "",
productCostType: "",
productId: "",
productName: "",
productCode: "",
},
getListApi: getPackageManageList,
searchFormSchema: [],
......@@ -238,6 +244,16 @@ export default {
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: {
...mapActions({
get: "d2admin/base/get",
......@@ -273,6 +289,10 @@ export default {
goodsSource: 0,
financeCheckFlag: "",
inventoryType: "",
productCostType: "",
productId: "",
productName: "",
productCode: "",
};
this.applicableAreas = [];
// 重新查询
......
......@@ -168,7 +168,6 @@ export default {
},
metricName(item) {
let { metricConfigs } = this
console.log(metricConfigs)
if (metricConfigs && metricConfigs.length) return metricConfigs.find(e => e.metricCode == item.guaranteeIndex)?.metricName || '-'
return '-'
},
......@@ -176,7 +175,6 @@ export default {
return JSON.parse(data)
},
formatGuaranteeItem(i, item) {
console.log(i)
let unit = i.unit || ''
return `满足${i.startValue}${unit} &le; ${this.metricName(item)}&lt;${i.endValue}${unit}时,差距订单数每单赔付${i.compensationAmount}元`
}
......
......@@ -23,7 +23,8 @@
</el-select>
</template>
<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">
<el-radio :key="r.value" :label="r.value">{{ r.label }}</el-radio>
</template>
......@@ -145,6 +146,7 @@ export default {
this.selectionChange(val.guaranteeIndex, false)
if (val.ladderConditions) this.ladderConditions = JSON.parse(val.ladderConditions)
}
this.formRef && this.formRef.clearValidate()
},
deep: true,
immediate: true
......@@ -164,22 +166,6 @@ export default {
},
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: {
......@@ -206,7 +192,20 @@ export default {
},
mounted() { },
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) {
let item = this.conditionForm[1],
{ conditionStartConfig, conditionEndConfig } = this,
......
......@@ -133,7 +133,6 @@ export default {
data: {
handler(newVal) {
this.componentData = deepClone(newVal)
console.log(JSON.parse(JSON.stringify(newVal)))
this.$nextTick(() => {
this.formRef.clearValidate()
})
......
......@@ -224,7 +224,6 @@ export default {
})
}
if (item.hasGuarantee == 1) {
console.log('item.guaranteeConfigs', item.guaranteeConfigs)
if (item.guaranteeConfigs && item.guaranteeConfigs.length) {
item.guaranteeConfigs.forEach((c, num) => {
if (c.guaranteeStandard == null || c.guaranteeIndex == '') {
......@@ -256,7 +255,6 @@ export default {
params.trafficPartyDetails = i.trafficPartyDetails
sceneConfigs.push(params)
})
console.log(sceneConfigs)
if (flag) callback(true, { sceneConfigs })
else callback(false, message)
} else callback(false)
......
......@@ -25,6 +25,7 @@
<template v-if="pageComplete">
<el-button v-if="pageType == 'audit' && step == 4" type="primary" @click="rejectDialogVisible = true"
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>
</template>
......@@ -208,10 +209,15 @@ export default {
}
},
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 }),
{ basicApproveInfo, trafficPartyConfigs, operateLogs, shelfType, updStep } = data,
step = updStep ? updStep + 1 : 2
// step = 2
step = isPrevStep ? STEP - 1 : (updStep ? updStep + 1 : 2)
this.basicinformationData = data
let basicinformationFormList = JSON.parse(basicApproveInfo)
if (pageType != 'reapply') {
......@@ -363,7 +369,6 @@ export default {
}
} else throw message
} catch (error) {
console.log(error)
this.dialogVisible = false
this.buttonLoading = false
setTimeout(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!