Commit dcca0159 by Jaxon

feat(套餐管理): 结构调整

1 parent 3c44cf46
......@@ -487,7 +487,7 @@ export const routerName = {
handle: "handleBatchModifyInventory",
},
],
component: _import("goods/packageManage/index"),
component: _import("goods/packageManage/views/table/index"),
},
9031202: {
path: "/editPackage",
......@@ -499,7 +499,7 @@ export const routerName = {
sideHidden: true,
activePath: "/packageManage",
},
component: _import("goods/packageManage/editPackage"),
component: _import("goods/packageManage/views/modify/index"),
},
9031205: {
path: "/packageView",
......@@ -519,7 +519,7 @@ export const routerName = {
handle: "handleCheck",
},
],
component: _import("goods/packageManage/packageView"),
component: _import("goods/packageManage/views/detail/index"),
},
90314: {
path: "/purchaseOnShelves",
......
<!-- 查看上架 -->
<template>
<d2-container class="edit-commodity">
<div class="" v-if="show">
<detail ref="d2PackageDetail" :rules="rules" form-name="grounding" :origin-data="editData" :form-list="editForm"
@handleCheck="handleCheck"
@handleClose="handleAddClose"></detail>
</div>
</d2-container>
</template>
<script>
import { getPackageDetailInfo, batchCheckPackage } from '@api/packageManage'
import detail from './components/detail.vue'
import { sceneList, BaseData } from '@/common/constants.js'
import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util'
import { baseConfig } from "@/main"
import { packageGoodsDetail, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from '../grounding/constants/data'
import { filterSpecsStr, convertYuanToWan } from "../filterOption"
import { getOperationCost } from '@api/grounding'
export default {
name: 'PackageDetail',
components: {
detail
},
data() {
return {
extendedPosiType: baseConfig.extendedPosiType || [], // 延保类
rules: {
merchantGoodsRefList: [{ required: true }],
packageName: [{ required: true }],
baseSceneName: [{ required: true }],
positionStr: [{ required: true }],
upgradeGoodsName: [{ required: true }],
sellPrice: [{ required: true }],
minSellPrice: [{ required: true }],
djCost: [{ required: true }],
thirdPartyCost: [{ required: true }],
upgradeProductCost: [{ required: true }],
recoveryCost: [{ required: true }],
virtualAccountCost: [{ required: true }],
financeCheckFlagStr: [{ required: true }]
},
editForm: [{
title: '套餐信息',
formBlock: [{
name: 'packageName',
label: '套餐名称'
}, {
name: 'packageAlias',
label: '套餐别名'
}, {
name: 'sellPrice',
label: '售价',
// unit: true
isPrice: true
}, {
name: 'minSellPrice',
label: '最低售价',
// unit: true
isPrice: true
}, {
name: 'upgradeProductCost',
label: '产品、升级成本',
// unit: true
isPrice: true
}, {
name: 'recoveryCost',
label: '回收成本',
// unit: true
isPrice: true
}, {
name: 'virtualAccountCost',
label: '虚拟对账成本',
// unit: true
isPrice: true
}, {
name: 'djCost',
label: '嘀加成本',
// unit: true
isPrice: true
}, {
name: 'thirdPartyCost',
label: '第三方成本',
// unit: true
isPrice: true
}, {
name: 'financeCheckFlagStr',
label: '财务规则校验'
}]
}, {
title: '门店信息',
formBlock: [{
name: 'baseSceneName',
label: '业务场景'
}, {
name: 'merchantGoodsRefList',
label: '上架门店',
type: 'table'
}, {
name: 'voucherList',
label: '上架凭证',
type: 'upload'
}]
}, {
title: '商品信息',
formBlock: []
}, {
title: '操作信息',
formBlock: [{
type: 'checkView',
name: 'reviewLogList'
}]
}],
show: false,
editData: {},
examineFlag: false,
detailId: '',
warrantyTypeShow: {
0: '质保卡',
1: '质保权益卡'
},
filterSpecsStr
}
},
mounted() {
this.getBaseData()
// 获取商品详情
const id = this.$route.query.id
this.detailId = id
if (!id) return this.show = true
this.getDetailInfo(id)
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getDetailInfo(id) {
getPackageDetailInfo({ id }).then(async res => {
res.reviewLogList?.forEach(val => {
val.updatedDateStr = val.updatedDate ? Util.dateFormate(val.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
})
let arr = []
if (res.sceneType == 3) { // 1.3场景 升级产品供货模式
arr = crowdUpgradeSupplyModeList
}
res.groundingGoodsList = []
for (const val of (res?.merchantGoodsInfoList || [])) {
if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList
}
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo || {}
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
this.editForm[2].formBlock.push(packageGoodsDetail)
// 太阳膜类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || []
// 实时计算运营成本
const costResult = await getOperationCost({ commodityCode: val?.upgradeCommodityCode, merchantIdList: res?.merchantGoodsRefList?.map(v => { return v.merchantId }) })
res.groundingGoodsList.push({
goodsType: val?.goodsType, // 类目值
upgradeGoodsId: val?.upgradeGoodsId, // 升级商品Id
goodsAlias: val?.goodsAlias || '-', // 商品别名
positionStr: deepClone(this.positionTypeList)?.filter(subVal => val?.position == subVal.position)[0]?.confName || '', // 上架部位
sellPrice: val?.sellPrice, // 售价
minSellPrice: val?.minSellPrice, // 最低售价
validMinSellPrice: val?.validMinSellPrice, // 是否校验最低价
djCost: val?.djCost, // 嘀加成本
thirdPartyCost: val?.thirdPartyCost, // 第三方成本
supplierCode: val?.goodsInfo?.supplierCode, // 供应方
warrantyTypeStr: this.warrantyTypeShow[val?.warrantyType] || '-', // 质保卡类型
upgradeSupplyMode: val?.upgradeSupplyMode,
upgradeSupplyModeStr: arr?.filter(v => v.confId == val.upgradeSupplyMode)[0]?.confName || '', // 升级产品供货模式
upgradeProductCost: val?.upgradeProductCost, // 升级产品成本
virtualAccountCost: val?.virtualAccountCost, // 虚拟对账成本
recoveryCost: val?.recoveryCost, // 回收成本
warrantyPeriod: val?.upgradeGoods?.warrantyPeriod, // 质保年限
upgradePrice: val?.upgradeGoods?.upgradePrice, // 参考售价
upgradeGoods: {
...val?.upgradeGoods,
goodsName: val.goodsName,
upgradeGoodsName: val?.upgradeGoodsName,
goodsTypeName: val?.goodsTypeName, // 升级商品所属类目
tempGoodsTypeName: result,
serviceItemNames: val?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})?.join(','), // 服务项目
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(val?.upgradeGoods),
carTypeConfigName: val?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
upgradeCommodityCode: val?.upgradeCommodityCode,
operationCost: costResult?.operationCost
}
})
}
res.baseSceneName = res.baseSceneName || '-'
res.financeCheckFlagStr = res.financeCheckFlag == 'Y' ? '开启' : res.financeCheckFlag == 'N' ? '关闭' : '-'
res.merchantGoodsRefList = res.merchantGoodsRefList || []
res.voucherList = res?.voucherList || []
this.editData = res || {}
this.$nextTick(() => {
this.show = true
})
})
},
filterEmpty(data) {
return (data ?? '') === ''
},
handleCheck() {
this.$confirm('<p>审核通过后,套餐完成上架,对应的门店可使用该商品</p>是否确定审核?', '提示', {
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(() => {
batchCheckPackage({ ids: [this.detailId] }).then(res => {
this.notice.okTips()
this.handleClose(true)
})
}).catch(err => {
console.log(err)
})
},
handleClose() {
this.close({ tagName: '/packageManage' })
this.$router.push({ name: 'packageManage' })
this.close({ tagName: '/packageView' })
},
handleAddClose() {
this.handleClose()
}
}
}
</script>
<style lang="scss" scoped></style>
<!-- 查看上架 -->
<template>
<d2-container class="edit-commodity">
<div v-if="show" class="">
<Detail ref="d2PackageDetail"
form-name="grounding"
:form-list="editForm"
:origin-data="editData"
:rules="rules"
@handleCheck="handleCheck"
@handleClose="handleAddClose">
</Detail>
</div>
</d2-container>
</template>
<script>
import { getOperationCost } from "@api/grounding";
import { batchCheckPackage, getPackageDetailInfo } from "@api/packageManage";
import { mapActions } from "vuex";
import { BaseData, sceneList } from "@/common/constants.js";
import { deepClone, Util } from "@/common/util";
import { baseConfig } from "@/main";
import { convertYuanToWan, filterSpecsStr } from "@/views/goods/filterOption";
import { crowdUpgradeSupplyModeList, packageGoodsDetail, upgradeSupplyModeList } from "@/views/goods/grounding";
import detail from "@/views/goods/packageManage/components/detail.vue";
export default {
name: "PackageDetail",
components: {
Detail: detail,
},
data() {
return {
extendedPosiType: baseConfig.extendedPosiType || [], // 延保类
rules: {
merchantGoodsRefList: [{ required: true }],
packageName: [{ required: true }],
baseSceneName: [{ required: true }],
positionStr: [{ required: true }],
upgradeGoodsName: [{ required: true }],
sellPrice: [{ required: true }],
minSellPrice: [{ required: true }],
djCost: [{ required: true }],
thirdPartyCost: [{ required: true }],
upgradeProductCost: [{ required: true }],
recoveryCost: [{ required: true }],
virtualAccountCost: [{ required: true }],
financeCheckFlagStr: [{ required: true }],
},
editForm: [{
title: "套餐信息",
formBlock: [{
name: "packageName",
label: "套餐名称",
}, {
name: "packageAlias",
label: "套餐别名",
}, {
name: "sellPrice",
label: "售价",
// unit: true
isPrice: true,
}, {
name: "minSellPrice",
label: "最低售价",
// unit: true
isPrice: true,
}, {
name: "upgradeProductCost",
label: "产品、升级成本",
// unit: true
isPrice: true,
}, {
name: "recoveryCost",
label: "回收成本",
// unit: true
isPrice: true,
}, {
name: "virtualAccountCost",
label: "虚拟对账成本",
// unit: true
isPrice: true,
}, {
name: "djCost",
label: "嘀加成本",
// unit: true
isPrice: true,
}, {
name: "thirdPartyCost",
label: "第三方成本",
// unit: true
isPrice: true,
}, {
name: "financeCheckFlagStr",
label: "财务规则校验",
}],
}, {
title: "门店信息",
formBlock: [{
name: "baseSceneName",
label: "业务场景",
}, {
name: "merchantGoodsRefList",
label: "上架门店",
type: "table",
}, {
name: "voucherList",
label: "上架凭证",
type: "upload",
}],
}, {
title: "商品信息",
formBlock: [],
}, {
title: "操作信息",
formBlock: [{
type: "checkView",
name: "reviewLogList",
}],
}],
show: false,
editData: {},
examineFlag: false,
detailId: "",
warrantyTypeShow: {
0: "质保卡",
1: "质保权益卡",
},
filterSpecsStr,
};
},
mounted() {
this.getBaseData();
// 获取商品详情
const id = this.$route.query.id;
this.detailId = id;
if (!id) {
return this.show = true;
}
this.getDetailInfo(id);
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList);
},
getDetailInfo(id) {
getPackageDetailInfo({ id }).then(async (res) => {
res.reviewLogList?.forEach((val) => {
val.updatedDateStr = val.updatedDate ? Util.dateFormate(val.updatedDate, "YYYY-MM-DD HH:mm:ss") : "";
});
let arr = [];
if (res.sceneType == 3) { // 1.3场景 升级产品供货模式
arr = crowdUpgradeSupplyModeList;
}
res.groundingGoodsList = [];
for (const val of (res?.merchantGoodsInfoList || [])) {
if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList;
}
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo || {};
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName];
const result = types.filter(type => type).join("-");
this.editForm[2].formBlock.push(packageGoodsDetail);
// 太阳膜类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(","))?.includes(subVal.position + "")) || [];
// 实时计算运营成本
const costResult = await getOperationCost({ commodityCode: val?.upgradeCommodityCode, merchantIdList: res?.merchantGoodsRefList?.map((v) => {
return v.merchantId;
}) });
res.groundingGoodsList.push({
goodsType: val?.goodsType, // 类目值
upgradeGoodsId: val?.upgradeGoodsId, // 升级商品Id
goodsAlias: val?.goodsAlias || "-", // 商品别名
positionStr: deepClone(this.positionTypeList)?.filter(subVal => val?.position == subVal.position)[0]?.confName || "", // 上架部位
sellPrice: val?.sellPrice, // 售价
minSellPrice: val?.minSellPrice, // 最低售价
validMinSellPrice: val?.validMinSellPrice, // 是否校验最低价
djCost: val?.djCost, // 嘀加成本
thirdPartyCost: val?.thirdPartyCost, // 第三方成本
supplierCode: val?.goodsInfo?.supplierCode, // 供应方
warrantyTypeStr: this.warrantyTypeShow[val?.warrantyType] || "-", // 质保卡类型
upgradeSupplyMode: val?.upgradeSupplyMode,
upgradeSupplyModeStr: arr?.filter(v => v.confId == val.upgradeSupplyMode)[0]?.confName || "", // 升级产品供货模式
upgradeProductCost: val?.upgradeProductCost, // 升级产品成本
virtualAccountCost: val?.virtualAccountCost, // 虚拟对账成本
recoveryCost: val?.recoveryCost, // 回收成本
warrantyPeriod: val?.upgradeGoods?.warrantyPeriod, // 质保年限
upgradePrice: val?.upgradeGoods?.upgradePrice, // 参考售价
upgradeGoods: {
...val?.upgradeGoods,
goodsName: val.goodsName,
upgradeGoodsName: val?.upgradeGoodsName,
goodsTypeName: val?.goodsTypeName, // 升级商品所属类目
tempGoodsTypeName: result,
serviceItemNames: val?.upgradeGoods?.upgradeGoodsServiceItemsList?.map((item) => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ""}`;
})?.join(","), // 服务项目
positionNames: positionNamesArr.length
? positionNamesArr.map((subItem) => {
return subItem?.confName;
}).join("/")
: "",
specificationData: this.filterSpecsStr(val?.upgradeGoods),
carTypeConfigName: val?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join("/"),
upgradeCommodityCode: val?.upgradeCommodityCode,
operationCost: costResult?.operationCost,
},
});
}
res.baseSceneName = res.baseSceneName || "-";
res.financeCheckFlagStr = res.financeCheckFlag == "Y" ? "开启" : res.financeCheckFlag == "N" ? "关闭" : "-";
res.merchantGoodsRefList = res.merchantGoodsRefList || [];
res.voucherList = res?.voucherList || [];
this.editData = res || {};
this.$nextTick(() => {
this.show = true;
});
});
},
filterEmpty(data) {
return (data ?? "") === "";
},
handleCheck() {
this.$confirm("<p>审核通过后,套餐完成上架,对应的门店可使用该商品</p>是否确定审核?", "提示", {
confirmButtonText: "确定",
dangerouslyUseHTMLString: true,
type: "warning",
}).then(() => {
batchCheckPackage({ ids: [this.detailId] }).then((res) => {
this.notice.okTips();
this.handleClose(true);
});
}).catch((err) => {
console.log(err);
});
},
handleClose() {
this.close({ tagName: "/packageManage" });
this.$router.push({ name: "packageManage" });
this.close({ tagName: "/packageView" });
},
handleAddClose() {
this.handleClose();
},
},
};
</script>
<style lang="scss" scoped></style>
<!-- 套餐编辑 -->
<template>
<d2-container v-loading="!show" class="edit-package">
<div v-if="show" class="">
<PackageForm ref="d2GroundingForm"
:add-or-edit="addOrEdit"
:form-list="editForm"
:form-ref="proFormRef"
:goods-select-list="goodsSelectList"
:origin-data="editData"
:sceneCodeList="sceneCodeList"
:position-type-list="positionTypeList"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose">
</PackageForm>
</div>
</d2-container>
<d2-container v-loading="!show" class="edit-package">
<div v-if="show" class="">
<PackageForm ref="d2GroundingForm"
:add-or-edit="addOrEdit"
:form-list="editForm"
:form-ref="proFormRef"
:goods-select-list="goodsSelectList"
:origin-data="editData"
:position-type-list="positionTypeList"
:scene-code-list="sceneCodeList"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose">
</PackageForm>
</div>
</d2-container>
</template>
<script>
......@@ -25,9 +25,9 @@ import { mapActions } from "vuex";
import { BaseData } from "@/common/constants.js";
import { deepClone } from "@/common/util";
import { baseConfig } from "@/main";
import { convertYuanToWan, filterSpecsStr } from "../filterOption";
import { packageGoodsForm } from "../grounding/constants/data";
import packageForm from "./components/packageForm.vue";
import { convertYuanToWan, filterSpecsStr } from "@/views/goods/filterOption";
import { packageGoodsForm } from "@/views/goods/grounding/index.js";
import packageForm from "@/views/goods/packageManage/components/packageForm.vue";
export default {
name: "EditPackage",
......@@ -35,7 +35,7 @@ export default {
PackageForm: packageForm,
},
beforeRouteEnter(to, from, next) {
if (to.query.addOrEdit == "edit") {
if (to.query.addOrEdit === "edit") {
to.meta.title = "编辑套餐";
} else {
to.meta.title = "新增套餐";
......@@ -214,7 +214,7 @@ export default {
}),
initData() {
// 获取业务场景数据
getBaseSceneCodeList({status: 1}).then((res) => {
getBaseSceneCodeList({ status: 1 }).then((res) => {
this.sceneCodeList = res || [];
this.getBaseData();
const id = this.$route.query.id;
......@@ -293,8 +293,9 @@ export default {
}
res.financeCheckFlag = res?.financeCheckFlag;
res.voucherList.forEach((val) => { // 处理上传进度 默认进度100%
if (val.voucherFileUrl)
if (val.voucherFileUrl) {
val.uploadProgress = 100;
}
});
res.merchantGoodsRefList = res.merchantGoodsRefList.map((item) => {
return {
......@@ -322,18 +323,19 @@ export default {
this.confirm(num, data);
},
filterBaseSceneCodeBySceneType(targetTypes) {
const types = [].concat(targetTypes)
const types = [].concat(targetTypes);
return this.sceneCodeList?.flatMap(val =>
types.includes(val.sceneType) ? [val.baseSceneCode] : []
) || []
types.includes(val.sceneType) ? [val.baseSceneCode] : [],
) || [];
},
confirm(num, data) {
// 1保存并上架 2存草稿
const formObj = {};
this.editForm.forEach((val) => {
val.formBlock.forEach((v) => {
if (v.name)
if (v.name) {
formObj[v.name] = data[v.name];
}
});
});
const arr = [];
......@@ -409,15 +411,19 @@ export default {
merchantGoodsInfoList,
};
// 套餐至少包含两个以上产品
if (merchantGoodsInfoList?.length < 2)
if (merchantGoodsInfoList?.length < 2) {
return this.$message.warning("套餐至少需包含两个产品");
}
// 套餐总售价需大于零
if (formObj?.sellPrice <= 0)
if (formObj?.sellPrice <= 0) {
return this.$message.warning("套餐总售价需大于零,请检查套餐包含产品售价");
if (merchantGoodsInfoList?.findIndex(v => this.membraneTypeList.includes(v.goodsType)) > -1 && !this.filterBaseSceneCodeBySceneType(1)?.includes(data?.baseSceneCode))
}
if (merchantGoodsInfoList?.findIndex(v => this.membraneTypeList.includes(v.goodsType)) > -1 && !this.filterBaseSceneCodeBySceneType(1)?.includes(data?.baseSceneCode)) {
return this.$message.warning("膜类产品仅支持上架精品升级场景");
if (merchantGoodsInfoList?.findIndex(v => this.extendedPosiType?.concat(this.equitySceneType)?.includes(v.goodsType)) > -1 && !this.filterBaseSceneCodeBySceneType(0)?.includes(data?.baseSceneCode))
}
if (merchantGoodsInfoList?.findIndex(v => this.extendedPosiType?.concat(this.equitySceneType)?.includes(v.goodsType)) > -1 && !this.filterBaseSceneCodeBySceneType(0)?.includes(data?.baseSceneCode)) {
return this.$message.warning("延保、权益类产品仅支持上架至延保&权益业务场景");
}
this.editData = data;
// 判断套餐的所有子产品适用车型是否存在交集(无适用车型默认为全部)
let seriesIdFlag = false;
......@@ -487,8 +493,9 @@ export default {
},
dealObjectValue(obj) {
let param = {};
if (obj === null || obj === undefined || obj === "")
if (obj === null || obj === undefined || obj === "") {
return param;
}
for (let key in obj) {
if (obj[key] !== null && obj[key] !== undefined && obj[key] !== "") {
param[key] = obj[key];
......
import { getShopMerchantList } from "@api/deviceManage";
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";
export async function getSearchFormSchema(_refreshTable) {
const refreshTable = isFunction(_refreshTable) ? _refreshTable : () => {};
// 获取服务商
const merchantServiceList = await getShopMerchantList();
// 获取园区店
const yqMerchantServiceList = await getParkStore({});
yqMerchantServiceList.forEach((item) => {
item.yqMerchantId = item.merchantNo;
item.yqMerchantName = item.merchantName;
});
// 获取业务场景数据
const baseSceneList = await getBaseSceneCodeList();
return [
{
label: "套餐名称",
name: "packageName",
maxlength: "50",
type: "input",
isClear: true,
keyFn: refreshTable,
},
{
label: "套餐别名",
name: "packageAlias",
maxlength: "50",
type: "input",
isClear: true,
keyFn: refreshTable,
},
{
label: "套餐ID",
name: "matchPackageCode",
addHtml: "matchPackageCode",
},
{
label: "上架门店",
name: "merchantId",
type: "select",
optionList: merchantServiceList || [],
optionId: "merchantId",
optionLabel: "merchantName",
optionsName: "merchantServiceList",
},
{
label: "服务对接",
name: "yqMerchantId",
type: "select",
optionList: yqMerchantServiceList || [],
optionId: "yqMerchantId",
optionLabel: "yqMerchantName",
optionsName: "yqMerchantServiceList",
},
{
label: "业务场景",
name: "baseSceneCodeList",
type: "select",
optionList: baseSceneList,
optionId: "baseSceneCode",
optionLabel: "name",
optionsName: "baseSceneList",
},
{
label: "状态",
name: "status",
type: "select",
optionList: cloneDeep(statusList),
optionId: "confId",
optionLabel: "confValue",
optionsName: "statusList",
},
{
label: "财务校验",
name: "financeCheckFlag",
type: "select",
optionList: cloneDeep(financeCheckFlagList),
optionId: "confId",
optionLabel: "confValue",
optionsName: "financeCheckFlagList",
},
{
label: "库存模式",
name: "inventoryType",
type: "select",
optionList: cloneDeep(inventoryTypeList),
optionId: "confId",
optionLabel: "confValue",
optionsName: "inventoryTypeList",
},
{
label: "适用区域",
name: "applicableArea",
addHtml: "applicableAreaSelect",
},
];
}
export async function getTableColumnsSchema() {
return [
{
label: "序号",
prop: "ownSerialNum",
type: "ownSerialNum",
width: "100",
},
{
label: "套餐ID",
prop: "packageCode",
width: "200",
formatter: (cellValue) => {
return cellValue.packageCode || "-";
},
},
{
label: "套餐名称",
prop: "packageName",
width: "150",
formatter: (cellValue) => {
return cellValue.packageName || "-";
},
},
{
label: "套餐别名",
prop: "packageAlias",
width: "150",
formatter: (cellValue) => {
return cellValue.packageAlias || "-";
},
},
{
label: "售价/元",
prop: "sellPrice",
formatter: (cellValue) => {
return priceFilter(cellValue.sellPrice);
},
},
{
label: "最低售价/元",
prop: "minSellPrice",
formatter: (cellValue) => {
return priceFilter(cellValue.minSellPrice);
},
width: "100",
},
{
label: "产品、升级成本/元",
prop: "upgradeProductCost",
formatter: (cellValue) => {
return priceFilter(cellValue.upgradeProductCost);
},
width: "150",
},
{
label: "虚拟对账成本/元",
prop: "virtualAccountCost",
formatter: (cellValue) => {
return priceFilter(cellValue.virtualAccountCost);
},
width: "150",
},
{
label: "回收成本/元",
prop: "recoveryCost",
formatter: (cellValue) => {
return priceFilter(cellValue.recoveryCost);
},
width: "100",
},
{
label: "嘀加成本/元",
prop: "djCost",
formatter: (cellValue) => {
return priceFilter(cellValue.djCost);
},
width: "100",
},
{
label: "第三方成本/元",
prop: "thirdPartyCost",
formatter: (cellValue) => {
return priceFilter(cellValue.thirdPartyCost);
},
width: "120",
},
{
label: "库存模式",
prop: "inventoryType",
width: "120",
formatter: (cellValue) => {
return cellValue.inventoryType == 1 ? "虚拟" : cellValue.inventoryType == 2 ? "实物" : "-";
},
},
{
label: "上架门店",
name: "",
type: "slot",
addHtml: "merchantName",
width: 100,
},
{
label: "服务对接",
prop: "yqMerchantName",
type: "slot",
addHtml: "yqMerchantName",
width: 100,
},
{
label: "业务场景",
prop: "baseSceneName",
width: 130,
},
{
label: "状态",
prop: "status",
width: "100px",
className: (cellValue) => {
return {
3: "ashSpot",
4: "yellowSpot",
1: "greenSpot",
0: "ashSpot",
}[cellValue.status];
},
formatter: (cellValue) => {
return {
3: "草稿",
4: "待审核",
1: "已上架",
0: "已下架",
}[cellValue.status];
},
},
{
label: "财务校验",
prop: "financeCheckFlag",
width: "100px",
formatter: (cellValue) => {
return cellValue.financeCheckFlag == "Y" ? "开启" : "关闭";
},
},
{
label: "创建日期",
prop: "createdDate",
width: "150",
formatter: (cellValue) => {
return cellValue.createdDate ? Util.dateFormate(cellValue.createdDate, "YYYY-MM-DD HH:mm:ss") : "";
},
},
];
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!