Commit 9a0f0d7c by zhangxw

产品管理/上架管理/套餐管理

1 parent b54d9727
Showing 42 changed files with 670 additions and 377 deletions
......@@ -181,3 +181,9 @@ export function savePaymentChannelConfig(data) {
data.method = `${path}paymentChannelConfig.save`;
return request(data, "post");
}
// 根据已选产品实时查询运营成本
export function getOperationCost(data) {
data.method = 'dj.api.smartcarlife.merchantGoodsInfo.operationCost.calculate'
return request(data, "post")
}
......@@ -112,30 +112,66 @@ export function upgradeGoodsDelete(data) {
// 获取产品清单列表
export function getProductCatalogList(data) {
data.method = "";
data.method = "dj.api.smartcarlife.productTemplate.page";
return request(data);
}
// 新增产品(产品清单)
export function addProductCatalog(data) {
data.method = "";
return request(data);
}
// 编辑产品(产品清单)
export function editProductCatalog(data) {
data.method = "";
return request(data);
// 新增/编辑产品(产品清单)
export function addOrUpdateProductCatalog(data) {
data.method = "dj.api.smartcarlife.productTemplate.addOrUpdate";
return request(data, 'post');
}
// 删除产品(产品清单)
export function deleteProductCatalog(data) {
data.method = "";
data.method = "dj.api.smartcarlife.productTemplate.delete";
return request(data);
}
// 批量新增SPU/SKU导入
export function importBatchAddSPUOrSKU(data) {
data.method = "dj.api.smartcarlife.productManager.spu.sku.batch.add.import"
return request(data, "post", ["file"])
}
// 批量新增SKU导入
export function importBatchAddSKU(data) {
data.method = "dj.api.smartcarlife.productManager.sku.batch.add.import"
return request(data, "post", ["file"])
}
// 批量修改SKU导入
export function importBatchEditSKU(data) {
data.method = "dj.api.smartcarlife.productManager.sku.batch.update.import"
return request(data, "post", ["file"])
}
// 获取供应商数据
export function getGoodsProviderList(data) {
data.method = "dj.api.smartcarlife.goodsProvider.page"
return request(data)
}
// 新增供应商
export function addGoodsProvider(data) {
data.method = "dj.api.smartcarlife.goodsProvider.insert"
return request(data)
}
// 编辑供应商
export function editGoodsProvider(data) {
data.method = "dj.api.smartcarlife.goodsProvider.update"
return request(data)
}
// 获取省市两级数据
export function getAreaDataList(data) {
data.method = "";
data.method = "dj.api.smartcarlife.map.districts.provinceCity";
return request(data);
}
// 获取业务场景数据
export function getBaseSceneCodeList(data) {
data.method = "dj.api.smartcarlife.scene.getScenesByParams";
return request(data);
}
......@@ -82,6 +82,16 @@
{{ '' }}
</el-radio>
</template>
<template #areaName="scope">
<el-tooltip v-if="Array.isArray(scope.scope.upgradeGoodsAreaList) && scope.scope.upgradeGoodsAreaList.length" placement="top">
<div slot="content" class="car-type-list">
<div v-for="(item, index) in scope.scope.upgradeGoodsAreaList" :key="index">{{
item.provinceName == '全国' ? '全国' : `${item.provinceName}-${item.cityName}` }}</div>
</div>
<div>{{ scope.scope.upgradeGoodsAreaList | formatArea }}</div>
</el-tooltip>
<div v-else>-</div>
</template>
<template #carName="scope">
<el-tooltip v-if="scope.scope.carTypeConfigList && scope.scope.carTypeConfigList.length" placement="top">
<template #content>
......@@ -115,6 +125,13 @@ export default {
}).join(",");
return str.length > 15 ? str.substring(0, 15) + "..." : str;
},
formatArea(list) {
if (!Array.isArray(list)) return '-'
let str = list?.map(item => {
return item.provinceName == '全国' ? '全国' : `${item.provinceName}-${item.cityName}`
}).join(',')
return str.length > 15 ? str.substring(0, 15) + '...' : str
},
},
props: {
title: {
......@@ -142,6 +159,10 @@ export default {
type: Array,
default: () => [],
},
merchantIdList: {
type: Array,
default: () => []
}
},
data() {
return {
......@@ -257,11 +278,12 @@ export default {
},
}, {
label: "运营成本/元",
prop: "",
prop: "operationCost",
width: 150
}, {
label: "适用区域",
prop: "",
addHtml: "areaName",
width: 150
}, {
label: "适用车型",
......@@ -338,6 +360,10 @@ export default {
if (this.filterParams.length > 0) {
this.searchForm[this.sceneType === 1 ? "excludeGoodsTypeList" : "goodsTypeList"] = this.filterParams;
}
if (this.merchantIdList?.length) {
this.searchForm['merchantIds'] = this.merchantIdList?.map(val => { return val.merchantId })
}
this.searchForm.onShelfStatus = 1
resolve();
});
},
......
......@@ -11,7 +11,7 @@
:model="selectData"
:rules="rules">
<el-form-item label="业务场景:">
<el-input v-model="sceneList[selectedScene]"
<el-input v-model="selectedSceneObj.name"
disabled
style="width: 370px;">
</el-input>
......@@ -45,7 +45,6 @@
<script>
import { getAccountMerchantList, getList } from "@/api/merchant";
import { sceneList } from "@/common/constants.js";
export default {
name: "RelateStoreDialog",
directives: {
......@@ -71,9 +70,12 @@ export default {
type: Boolean,
default: false,
},
selectedScene: {
type: Number,
selectedSceneObj: {
type: Object,
},
baseSceneList: {
type: Array
}
},
data() {
return {
......@@ -95,13 +97,12 @@ export default {
methods: {
getList() {
const storeApi = [1, 2, 3].includes(this.selectedScene) ? getList : getAccountMerchantList; // 会员权益/积分商城场景 上架门店是账户中心所有门店
const storeApi = this.filterBaseSceneCodeBySceneType([1, 2, 3]).includes(this.selectedSceneObj?.baseSceneCode) ? getList : getAccountMerchantList; // 售前会员权益升级、售后会员权益升级、售前延保、售后延保场景 上架门店是账户中心所有门店
storeApi({
// merchantIdName: ![1, 2, 3].includes(this.selectedScene) ? this.searchMerchantName : '',
merchantName: this.searchMerchantName,
currentPage: this.currentPage,
pageSize: this.pageSize,
scene: this.selectedScene,
baseSceneCode: this.selectedSceneObj?.baseSceneCode,
}).then((res) => {
res?.list?.forEach((val) => { // 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo)
......@@ -110,6 +111,14 @@ export default {
this.storeData = this.storeData.concat(res.list);
});
},
filterBaseSceneCodeBySceneType(targetTypes) {
const types = [].concat(targetTypes)
return this.baseSceneList?.flatMap(val =>
types.includes(val.sceneType) ? [val.baseSceneCode] : []
) || []
},
// 获取上架门店
remoteMethod(query) {
this.searchMerchantName = query;
......
......@@ -27,7 +27,7 @@
<div class="item" v-for="(subItem, subIndex) in item.detailInfo" :key="subIndex">
<div class="label">{{ subItem.unit ? (membraneTypeList.includes(formData[item.key]) ? subItem.label + `(元)/${subItem.value == 'purchasePrice' ? '卷' : '车'}` : (subItem.label + '(元)/件')) : subItem.label }}:</div>
<div class="value">
<ellipsis-popover :content="subItem.unit ? priceFilter(formData.upgradeGoods[subItem.value]) : formData.upgradeGoods[subItem.value] || ''"></ellipsis-popover>
<ellipsis-popover :content="subItem.unit || subItem.type == 'price' ? priceFilter(formData.upgradeGoods[subItem.value]) : formData.upgradeGoods[subItem.value] || ''"></ellipsis-popover>
</div>
</div>
<!-- 权益/延保非第三方展示 -->
......
......@@ -35,7 +35,7 @@
</el-radio-group>
</el-form-item>
</div>
<!-- 1.3场景显示升级/产品供货模式 -->
<!-- 售后众筹显示升级/产品供货模式 -->
<div v-if="
item.type === 'radio'
&& item.index
......@@ -77,7 +77,7 @@
</div>
<div class="value">
<EllipsisPopover :content="
subItem.unit
subItem.unit || subItem.type == 'price'
? priceFilter(formData.upgradeGoods[subItem.value])
: formData.upgradeGoods[subItem.value] || ''
">
......@@ -419,13 +419,14 @@
</el-button>
</el-form-item>
</el-form>
<!-- store-api (1精品升级 2次新车转化 3售后众筹 查询嘀加的门店数据 getList)(0会员/权益升级 4积分商城 查询账户中心所有4s店 getAccountMerchantList -->
<!-- store-api (精品升级 次新车升配 售后众筹 查询嘀加的门店数据 getList)(售前会员权益升级 售后会员权益升级 售前延保 售后延保 二手车查询账户中心所有4s店 getAccountMerchantList -->
<RelateStoreDialog v-if="relateStoreVisible"
ref="formRelateStore"
:relate-store-visible="relateStoreVisible"
:selected-scene="formData.sceneType"
:selected-base-scene-code="formData.baseSceneCode"
:selected-scene-type="selectedSceneType"
:store-api="
[1, 2, 3].includes(formData.sceneType)
filterBaseSceneCodeBySceneType([1, 2, 3]).includes(`${formData.baseSceneCode}`)
? getList
: getAccountMerchantList
"
......@@ -477,6 +478,7 @@
<SelectGoodsDialog v-if="selectGoodsVisible"
:select-goods-visible="selectGoodsVisible"
:upgrade-goods-id="formData.upgradeGoodsId"
:merchant-id-list="formData.merchantGoodsRefList"
@handleSelectGoodsClose="handleSelectGoodsClose"
@handleSelectGoodsConfirm="handleSelectGoodsConfirm">
</SelectGoodsDialog>
......@@ -501,7 +503,7 @@ import {
} from "../constants/data";
import relateStoreDialog from "./relateStoreDialog.vue";
import relateStoreTable from "./relateStoreTable.vue";
import { getOperationCost } from "@api/grounding"
export default {
name: "GroundingForm",
components: {
......@@ -563,6 +565,9 @@ export default {
type: Array,
default: () => [],
},
sceneCodeList: {
type: Array
}
},
data() {
return {
......@@ -596,7 +601,7 @@ export default {
trigger: "change",
},
],
sceneType: [
baseSceneCode: [
{ required: true, message: "请选择业务场景", trigger: "change" },
],
upgradeGoodsId: [
......@@ -703,6 +708,7 @@ export default {
},
},
filterSpecsStr,
selectedSceneType: ''
};
},
......@@ -729,9 +735,9 @@ export default {
// },
// deep: true
// },
"formData.sceneType": {
"formData.baseSceneCode": {
handler(newVal, oldVal) {
this.oldSceneType = oldVal || newVal;
this.oldBaseSceneCode = oldVal || newVal;
},
},
"formData.voucherList": {
......@@ -828,6 +834,12 @@ export default {
this.handleOssUpload(fileInfo, fileName, success, fail);
}, 50);
},
filterBaseSceneCodeBySceneType(targetTypes) {
const types = [].concat(targetTypes)
return this.sceneCodeList?.flatMap(val =>
types.includes(val.sceneType) ? [val.baseSceneCode] : []
) || []
},
handleOssUpload(file, fileName, success, fail) {
const bucketName = "jinrong-huidan-test"; // 桶名
const fileType = fileName.substr(fileName.lastIndexOf(".") + 1);
......@@ -884,9 +896,9 @@ export default {
// 过滤form表单显示内容
filterEditForm() {
const { copyFormList, formData } = this;
// 1 太阳膜 2 (1.3场景产品)
// 1 太阳膜 2 (售后众筹产品)
const shopType
= formData?.goodsType == 1 ? "1" : formData?.sceneType == 3 ? "2" : "";
= formData?.goodsType == 1 ? "1" : this.filterBaseSceneCodeBySceneType(3)?.includes(formData?.baseSceneCode) ? "2" : "";
const shopForm = deepClone(copyFormList[1].formBlock);
const spliceForm
= shopType == "1"
......@@ -975,7 +987,7 @@ export default {
const formIndex = this.formList[1].formBlock.findIndex(
subItem => subItem.name == "upgradeSupplyMode",
);
if (formData.sceneType == 3) {
if (this.filterBaseSceneCodeBySceneType(3)?.includes(formData.baseSceneCode)) {
if (formIndex >= 0) {
this.$set(
this.formList[1].formBlock[formIndex],
......@@ -1000,7 +1012,6 @@ export default {
this.positionTypeList?.forEach((val) => {
val.confId = val.position;
});
console.log(this.formList[1].formBlock)
this.$set(
this.formList[1].formBlock[
this.formList[1].formBlock.findIndex(
......@@ -1034,7 +1045,8 @@ export default {
}
this.selectGoodsVisible = true;
},
handleSelectGoodsConfirm(selectedData) {
async handleSelectGoodsConfirm(selectedData) {
const costResult = await getOperationCost({commodityCode: selectedData?.commodityCode, merchantIdList: this.formData?.merchantGoodsRefList?.map(v => {return v.merchantId})})
const _formData = this.formData;
const _valueObj = selectedData;
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName }
......@@ -1068,6 +1080,7 @@ export default {
?.map(item => item.seriesName)
.join("/"),
upgradeCommodityCode: _valueObj?.commodityCode,
operationCost: costResult?.operationCost
}
;(_formData.goodsType = _valueObj?.goodsInfo?.goodsType),
(_formData.upgradeGoodsId = _valueObj.id);
......@@ -1087,7 +1100,7 @@ export default {
// 选择上架门店
handleClick() {
const _this = this;
if (_this.filterEmpty(_this.formData.sceneType)) {
if (_this.filterEmpty(_this.formData.baseSceneCode)) {
return this.$message.warning("请选择业务场景");
}
_this.storeSelected = deepClone(_this.formData.merchantGoodsRefList);
......@@ -1108,6 +1121,8 @@ export default {
}
});
this.formData.merchantGoodsRefList = selectedData;
// 清空产品信息
this.clearUpgradeGoods()
this.relateStoreVisible = false;
},
handleRelateStoreClose() {
......@@ -1126,6 +1141,8 @@ export default {
i => i.merchantId !== item.merchantId,
);
this.$set(this.formData, "merchantGoodsRefList", filterArr);
// 上架门店变更清除上架产品信息
this.clearUpgradeGoods()
},
// 下拉加载更多 下拉框显示隐藏触发
visibleChange(data) {
......@@ -1161,9 +1178,10 @@ export default {
_formData.merchantName = _tempVal.merchantName;
}
// 切换业务场景 将选中的上架门店清空
if (targetItem.name === "sceneType") {
if (targetItem.name === "baseSceneCode") {
const _formData = this.formData;
if (!this.filterEmpty(this.oldSceneType)) {
this.selectedSceneType = `${targetItem?.optionList?.find(val => val.baseSceneCode == value)?.sceneType}`
if (!this.filterEmpty(this.oldBaseSceneCode)) {
// 清空门店弹窗搜索条件
this.storeSearchForm = {
merchantName: "",
......@@ -1177,23 +1195,50 @@ export default {
type: "warning",
})
.then(() => {
_formData.sceneType = value;
_formData.baseSceneCode = value;
this.selectedSceneType = `${targetItem?.optionList?.find(val => val.baseSceneCode == value)?.sceneType}`
this.$nextTick(() => {
this.$refs.selectRefs_sceneType[0].blur();
this.$refs.selectRefs_baseSceneCode[0].blur();
_formData.merchantGoodsRefList = [];
// 清空产品信息
this.clearUpgradeGoods()
this.$forceUpdate();
});
})
.catch(() => {
_formData.sceneType = this.oldSceneType;
_formData.baseSceneCode = this.oldBaseSceneCode;
this.selectedSceneType = `${targetItem?.optionList?.find(val => val.baseSceneCode == this.oldBaseSceneCode)?.sceneType}`
this.$nextTick(() => {
this.$refs.selectRefs_sceneType[0].blur();
this.$refs.selectRefs_baseSceneCode[0].blur();
});
});
}
}
}
},
clearUpgradeGoods() {
this.formData = {
...this.formData,
upgradeGoodsId: "",
goodsCode: "",
goodsType: "",
productType: [],
baseSupplyMode: "",
upgradeSupplyMode: "",
sellPrice: "",
minSellPrice: "",
giveCostPrice: "",
recoveryCostPrice: "",
reconcilyCostPrice: "",
voucherList: [],
validMinSellPriceFlag: true,
validMinSellPrice: "Y",
sellPriceValidType: 1,
tempValidDate: [],
financeCheckFlag: "N",
}
this.filterEditForm()
},
handleClose() {
this.$emit("handleClose");
},
......
......@@ -106,13 +106,16 @@ export default {
type: Object,
default: () => {},
},
selectedScene: {
type: Number,
selectedBaseSceneCode: {
type: String,
},
isHide: {
type: Boolean,
default: false,
},
selectedSceneType: {
type: String
}
},
data() {
return {
......@@ -139,24 +142,19 @@ export default {
});
},
getSelectingList() {
const _storeSearchForm = this.storeSearchForm;
// 会员权益/积分商城获取账户中心所有门店 接口不同 接口新增查询参数merchantName 不需单独处理
// if ([0, 4].includes(this.selectedScene)) {
// // 会员权益,积分商城场景查询门店名称参数
// _storeSearchForm.merchantIdName = _storeSearchForm.merchantName // 账户中心所有门店接口查询条件
// }
this.storeApi({
...this.storeSearchForm,
currentPage: this.currentPage,
pageSize: this.pageSize,
scene: this.selectedScene,
baseSceneCode: this.selectedBaseSceneCode,
queryMerchantAddr: true
}).then((res) => {
res?.list?.forEach((val) => {
// 账户中心门店返回商户号字段是merchantNo
if (val.merchantNo)
val.merchantId = Number(val.merchantNo);
val?.sceneList?.forEach((subVal) => {
if (subVal.scene == this.selectedScene) {
if (subVal.scene == this.selectedSceneType) {
val.yqMerchantId = subVal?.yqMerchant?.merchantId || "-";
val.yqMerchantName = subVal?.yqMerchant?.merchantName || "-";
}
......
......@@ -82,7 +82,8 @@ export const packageGoodsForm = [{
value: "upgradeCommodityCode",
}, {
label: "运营成本/元",
value: ""
value: "operationCost",
type: 'price'
}],
}, {
name: "position",
......@@ -91,7 +92,7 @@ export const packageGoodsForm = [{
radioGroupList: [],
}, {
name: "goodsAlias",
label: "产品别名",
label: "商品别名",
type: "input",
maxlength: 50,
width: "432px",
......@@ -203,6 +204,10 @@ export const packageGoodsDetail = [
}, {
label: "产品ID",
value: "upgradeCommodityCode",
}, {
label: "运营成本/元",
value: "operationCost",
type: 'price'
}],
},
{
......
......@@ -6,6 +6,7 @@
:form-list="editForm"
:form-ref="proFormRef"
:origin-data="editData"
:sceneCodeList="sceneCodeList"
:position-type-list="positionTypeList"
:second-goods-list="secondGoodsList"
@handleAddConfirm="handleAddConfirm"
......@@ -16,14 +17,15 @@
</template>
<script>
import { addOrUpdateAPI, checkGroundingLog, getMerchantGoodsInfo } from "@api/grounding";
import { addOrUpdateAPI, checkGroundingLog, getMerchantGoodsInfo, getOperationCost } from "@api/grounding";
import { mapActions } from "vuex";
import { BaseData, sceneCodeList } from "@/common/constants.js";
import { BaseData } from "@/common/constants.js";
import { deepClone, Util } from "@/common/util";
import { baseConfig } from "@/main";
import { convertYuanToWan, filterSpecsStr } from "../filterOption";
import groundingForm from "./components/groundingForm.vue";
import { baseSupplyModeList, productList, upgradeSupplyModeList } from "./constants/data";
import { getBaseSceneCodeList } from '@api/productManage'
export default {
name: "EditGrounding",
components: {
......@@ -38,14 +40,14 @@ export default {
editForm: [{
title: "门店信息",
formBlock: [{
name: "sceneType",
name: "baseSceneCode",
label: "业务场景",
isRequired: true,
type: "select",
isClear: false,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionId: "baseSceneCode",
optionLabel: "name",
width: "432px",
}, {
name: "merchantGoodsRefList",
......@@ -106,8 +108,9 @@ export default {
label: "产品ID",
value: "upgradeCommodityCode",
}, {
label: "运营成本",
value: ""
label: "运营成本/元",
value: "operationCost",
type: 'price'
}],
}, {
name: "position",
......@@ -116,7 +119,7 @@ export default {
radioGroupList: [],
}, {
name: "goodsAlias",
label: "产品别名",
label: "商品别名",
type: "input",
maxlength: 50,
width: "432px",
......@@ -256,7 +259,6 @@ export default {
goodsCode: "",
goodsType: "",
productType: [],
sceneCode: "",
baseSupplyMode: "",
upgradeSupplyMode: "",
sellPrice: "",
......@@ -280,23 +282,29 @@ export default {
};
},
mounted() {
this.getBaseData();
const id = this.$route.query.id;
if (!id) {
this.$nextTick(() => {
this.show = true;
});
} else {
this.addOrEdit = "edit";
// 获取产品详情
this.getDetailInfo(id);
}
this.initData()
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
initData() {
// 获取业务场景数据
getBaseSceneCodeList({}).then(res => {
this.sceneCodeList = res || []
this.getBaseData();
const id = this.$route.query.id;
if (!id) {
this.$nextTick(() => {
this.show = true;
});
} else {
this.addOrEdit = "edit";
this.getDetailInfo(id);
}
})
},
async getBaseData() {
this.editForm.forEach((item) => {
item.formBlock && item.formBlock.forEach((v) => {
......@@ -311,15 +319,15 @@ export default {
v.radioGroupList = [];
}
}
if (v.name == "sceneType") { // 业务场景
v.optionList = sceneCodeList;
if (v.name == "baseSceneCode") { // 业务场景
v.optionList = this.sceneCodeList;
}
});
});
this.positionTypeList = await this.get(BaseData.positionTypeList);
},
getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then((res) => {
getMerchantGoodsInfo({ id }).then(async (res) => {
const productType = [];
if (res?.upgradeProductFlag == "Y")
productType.push(2);
......@@ -356,13 +364,16 @@ export default {
specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join("/"),
upgradeCommodityCode: res?.upgradeGoods?.commodityCode,
sellPriceValidType: res?.sellPriceValidType ? res?.sellPriceValidType + "" : "1",
sellPriceValidType: res?.sellPriceValidType ? res?.sellPriceValidType + "" : "1",
tempValidDate,
};
this.editData = res || {};
this.$nextTick(() => {
this.show = true;
});
// 实时计算运营成本
const costResult = await getOperationCost({ commodityCode: res?.upgradeCommodityCode, merchantIdList: res?.merchantGoodsRefList?.map(v => { return v.merchantId }) })
this.editData.upgradeGoods.operationCost = costResult?.operationCost
});
},
filterEmpty(data) {
......@@ -377,6 +388,12 @@ export default {
const { num } = data;
this.confirm(num, data);
},
filterBaseSceneCodeBySceneType(targetTypes) {
const types = [].concat(targetTypes)
return this.sceneCodeList?.flatMap(val =>
types.includes(val.sceneType) ? [val.baseSceneCode] : []
) || []
},
confirm(num, data, existCheck = true) {
// 1保存并上架 2存草稿
const formObj = {};
......@@ -395,7 +412,7 @@ export default {
arr.push({
merchantId: val.merchantId,
merchantName: val.merchantName,
inventoryType: val.inventoryType,
inventoryType: val.inventoryType,
});
});
const fileArr = [];
......@@ -418,22 +435,22 @@ export default {
voucherList: fileArr,
existCheck,
validMinSellPrice: data?.validMinSellPrice,
tempValidStartDate: data?.tempValidStartDate || "",
tempValidStartDate: data?.tempValidStartDate || "",
tempValidEndDate: data?.tempValidEndDate || "",
};
if (params.tempValidDate) {
delete params.tempValidDate;
};
if (data?.goodsType == 1 && data?.sceneType != 1)
if (data?.goodsType == 1 && !this.filterBaseSceneCodeBySceneType(1)?.includes(data?.baseSceneCode))
return this.$message.warning("太阳膜类产品仅支持上架至精品升级场景");
if (this.extendedPosiType.includes(data.goodsType) && data?.sceneType != 0)
return this.$message.warning("延保类产品仅支持上架至会员/权益升级场景");
if (this.extendedPosiType.includes(data.goodsType) && !this.filterBaseSceneCodeBySceneType(0)?.includes(data?.baseSceneCode))
return this.$message.warning("延保类产品仅支持上架至延保&权益业务场景 ");
this.editData = data;
const checkParams = {
id: data.id || "",
upgradeGoodsId: formObj.upgradeGoodsId,
position: formObj.position || "",
sceneType: formObj.sceneType,
baseSceneCode: formObj.baseSceneCode,
merchantIdList: arr?.map((val) => {
return val.merchantId;
}),
......@@ -460,6 +477,7 @@ export default {
}
},
checkEvent(checkParams, params, num) {
// this.confirmEvent(params, num);
checkGroundingLog(this.dealObjectValue(checkParams)).then((res) => {
if (res >= 1) {
this.$confirm("当前产品在对应门店已存在上架记录,是否确定保存?", "提示", {
......
......@@ -9,14 +9,15 @@
</d2-container>
</template>
<script>
import { getMerchantGoodsInfo, batchReviewAPI } from '@api/grounding'
import { getMerchantGoodsInfo, batchReviewAPI, getOperationCost } from '@api/grounding'
import detail from './components/detail.vue'
import { sceneList, BaseData } from '@/common/constants.js'
import { BaseData } from '@/common/constants.js'
import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util'
import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data'
import { baseConfig } from "@/main"
import { filterSpecsStr, convertYuanToWan } from '../filterOption'
import { getBaseSceneCodeList } from '@api/productManage'
export default {
name: 'GroundingDetail',
components: {
......@@ -27,7 +28,7 @@ export default {
extendedPosiType: baseConfig.extendedPosiType || [], // 延保类
rules: {
merchantGoodsRefList: [{ required: true }],
sceneName: [{ required: true }],
baseSceneName: [{ required: true }],
goodsName: [{ required: true }],
productTypeStr: [{ required: true }],
baseSupplyModeStr: [{ required: true }],
......@@ -47,7 +48,7 @@ export default {
editForm: [{
title: '门店信息',
formBlock: [{
name: 'sceneName',
name: 'baseSceneName',
label: '业务场景'
}, {
name: 'merchantGoodsRefList',
......@@ -95,14 +96,15 @@ export default {
value: 'upgradeCommodityCode'
}, {
label: '运营成本/元',
value: ''
value: 'operationCost',
type: 'price'
}]
}, {
name: 'positionStr',
label: '上架部位'
}, {
name: 'goodsAlias',
label: '产品别名'
label: '商品别名'
}, {
name: 'warrantyTypeStr',
label: '质保卡类型'
......@@ -175,22 +177,36 @@ export default {
},
mounted() {
this.getBaseData()
// 获取产品详情
const id = this.$route.query.id
this.detailId = id
if (!id) return this.show = true
this.getDetailInfo(id)
this.getBaseScene()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
}),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
},
getBaseScene() {
// 获取产品详情
const id = this.$route.query.id
this.detailId = id
if (!id) return this.show = true
getBaseSceneCodeList({}).then(res => {
this.baseSceneList = res || []
this.getDetailInfo(id)
}).catch(() => {
this.getDetailInfo(id)
})
},
filterBaseSceneCodeBySceneType(targetTypes) {
const types = [].concat(targetTypes)
return this.sceneCodeList?.flatMap(val =>
types.includes(val.sceneType) ? [val.baseSceneCode] : []
) || []
},
getDetailInfo(id) {
getMerchantGoodsInfo({ id }).then(res => {
getMerchantGoodsInfo({ id }).then(async res => {
const productType = []
if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1)
......@@ -199,7 +215,8 @@ export default {
const result = types.filter(type => type).join('-')
const productTypeTextArr = []
// 太阳膜/延保类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || []
const positionNamesArr = deepClone(this.positionTypeList).filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || []
// 产品类型
productList.forEach(v => {
if (productType.includes(v.confId)) productTypeTextArr.push(v.confName)
......@@ -208,7 +225,7 @@ export default {
val.updatedDateStr = val.updatedDate ? Util.dateFormate(val.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
})
let arr = []
if (res.sceneType == 3) { // 1.3场景 升级产品供货模式
if (this.filterBaseSceneCodeBySceneType(3)?.includes(res.baseSceneCode)) { // 售后众筹场景 升级产品供货模式
arr = crowdUpgradeSupplyModeList
} else {
arr = upgradeSupplyModeList
......@@ -217,7 +234,7 @@ export default {
res.warrantyTypeStr = this.warrantyTypeShow[res?.warrantyType] || '-'
res.baseSupplyModeStr = baseSupplyModeList?.filter(v => v.confId == res.baseSupplyMode)[0]?.confName || ''
res.upgradeSupplyModeStr = arr?.filter(v => v.confId == res.upgradeSupplyMode)[0]?.confName || ''
res.sceneName = sceneList[res.sceneType] || '-'
res.baseSceneName = this.baseSceneList?.find(item => item.baseSceneCode == res.baseSceneCode)?.name || '-'
res.productType = productType
res.merchantGoodsRefList = res.merchantGoodsRefList || []
res.voucherList = res?.voucherList || []
......@@ -241,12 +258,15 @@ export default {
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
upgradeCommodityCode: res?.upgradeGoods?.commodityCode
upgradeCommodityCode: res?.upgradeGoods?.commodityCode
}
this.editData = res || {}
this.$nextTick(() => {
this.show = true
})
})
// 实时计算运营成本
const costResult = await getOperationCost({ commodityCode: res?.upgradeCommodityCode, merchantIdList: res?.merchantGoodsRefList?.map(v => { return v.merchantId }) })
this.editData.upgradeGoods.operationCost = costResult?.operationCost
})
},
filterEmpty(data) {
......
......@@ -20,9 +20,14 @@
</el-cascader>
</template>
<template #applicableAreaSelect>
<ApplicableAreaSelect v-model="searchForm.applicableArea"
<!-- <ApplicableAreaSelect v-model="applicableAreas"
:options="baseData.applicableAreaList"
width="100%" />
width="100%"
@selection-change="handleAreaSelectChange" /> -->
<ApplicableAreaQuerySelect v-model="applicableAreas"
:options="baseData.applicableAreaList"
width="100%"
@change="val => handleAreaSelectChange(val)" />
</template>
</d2-search>
<div class="up-btns">
......@@ -179,7 +184,8 @@
<BatchCopyDialog v-if="batchCopyVisible"
ref="formBatchCopy"
:batch-copy-visible="batchCopyVisible"
:selected-scene="batchCopySelectScene"
:selected-scene-obj="batchCopySelectSceneObj"
:baseSceneList="baseData.baseSceneList"
@handleBatchCopyClose="handleBatchCopyClose"
@handleBatchCopyConfirm="handleBatchCopyConfirm">
</BatchCopyDialog>
......@@ -206,14 +212,15 @@ import { mapActions, mapMutations, mapState } from "vuex";
import { BaseData, sceneCodeList, sceneList } from "@/common/constants.js";
import { deepClone, Util } from "@/common/util";
import { baseConfig } from "@/main";
import ApplicableAreaSelect from "@/views/goods/components/applicable-area-select/index.vue";
// import ApplicableAreaSelect from "@/views/goods/components/applicable-area-select/index.vue";
import batchCopyDialog from "./components/batchCopyDialog.vue";
import BatchModifyInventoryDialog from "./components/batchModifyInventoryDialog.vue";
import { baseSupplyModeList, upgradeSupplyModeList } from "./constants/data";
import { getBaseSceneCodeList, getAreaDataList } from "@api/productManage"
import ApplicableAreaQuerySelect from '@/views/goods/components/applicable-area-query-select/index.vue'
export default {
name: "GroundingIndex",
components: { BatchCopyDialog: batchCopyDialog, BatchModifyInventoryDialog, ApplicableAreaSelect },
components: { BatchCopyDialog: batchCopyDialog, BatchModifyInventoryDialog, ApplicableAreaQuerySelect },
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
......@@ -222,7 +229,7 @@ export default {
baseGoodsName: "",
type: "",
merchantId: "",
sceneType: "",
baseSceneCodeList: "",
goodsCode: "",
goodsType: "",
secondaryGoodsType: "",
......@@ -233,7 +240,7 @@ export default {
goodsSource: 0,
financeCheckFlag: "",
inventoryType: "",
applicableArea: [],
cityCodeList: [],
},
tempGoodsType: [],
getListApi: getGroundingManageList,
......@@ -260,12 +267,12 @@ export default {
optionsName: "merchantServiceList",
}, {
label: "业务场景",
name: "sceneType",
name: "baseSceneCodeList",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "sceneCodeList",
optionId: "baseSceneCode",
optionLabel: "name",
optionsName: "baseSceneList",
}, {
label: "所属分类",
name: "goodsType",
......@@ -350,7 +357,7 @@ export default {
optionsName: "inventoryTypeList",
}, {
label: "适用区域",
name: "applicableArea",
name: "cityCodeList",
addHtml: "applicableAreaSelect",
}],
// 表格参数
......@@ -486,9 +493,9 @@ export default {
// },
{
label: "业务场景",
prop: "sceneType",
prop: "baseSceneCode",
formatter: (cellValue) => {
return sceneList[cellValue.sceneType] || "-";
return this.baseData.baseSceneList.find(val => val.baseSceneCode == cellValue.baseSceneCode)?.name || "-";
},
width: 130,
}, {
......@@ -651,19 +658,21 @@ export default {
confValue: "虚拟",
},
],
applicableAreaList: [],
baseSceneList: []
},
selfBuildGoodsType: baseConfig.selfBuildGoodsType || "",
batchCopySelectScene: "", // 批量复制选中的场景值
batchCopySelectSceneObj: {}, // 批量复制选中的业务场景
batchCopyVisible: false,
batchCopySelectData: [], // 批量辅助选中的上架数据
fileVisible: false,
fileVisible: false,
batchModifyInventoryVisible: false,
selectedTableData: [],
applicableAreas: [],
};
},
mounted() {
this.getBaseData();
this.getApplicableArea();
let allOpt = { confId: "", confValue: "全部" };
this.baseData.statusList.unshift(allOpt);
this.baseData.sceneCodeList = deepClone(sceneCodeList);
......@@ -693,6 +702,11 @@ export default {
this.baseData.productList = res?.list || [];
this.getOptionsList();
});
// 获取适用区域
this.getApplicableArea();
// 获取业务场景数据
this.getBaseCodeList()
this.getOptionsList()
},
computed: {
...mapState({
......@@ -724,10 +738,19 @@ export default {
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList);
},
getBaseCodeList() {
getBaseSceneCodeList({}).then(res => {
this.baseData.baseSceneList = res || []
this.getOptionsList()
})
},
getApplicableArea() {
this.get(BaseData.applicableAreaList).then((res) => {
this.baseData.applicableAreaList = Array.isArray(res) ? res : [];
});
getAreaDataList({}).then(res => {
this.baseData.applicableAreaList = res || []
})
},
handleAreaSelectChange(data) {
this.searchForm.cityCodeList = data?.map(val => { return val.cityCode })
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
......@@ -860,7 +883,7 @@ export default {
baseGoodsName: "",
type: "",
merchantId: "",
sceneType: "",
baseSceneCodeList: "",
goodsCode: "",
goodsType: "",
secondaryGoodsType: "",
......@@ -873,6 +896,7 @@ export default {
inventoryType: "",
};
this.tempGoodsType = [];
this.applicableAreas = []
// 重新查询
this.$refs.groundingIndexTable.refreshTable(true, true);
},
......@@ -918,7 +942,14 @@ export default {
});
},
handleExport() {
let params = this.searchForm;
let params = deepClone(this.searchForm);
if (params?.cityCodeList?.length) {
params.cityCodeList.forEach((item, index) => {
const name = `cityCodeList[${index}]`
params[name] = item
})
}
delete params.cityCodeList
params.method = "dj.api.smartcarlife.merchantGoodsInfo.export.async";
const list = [
...this.dowloadList,
......@@ -1050,16 +1081,18 @@ export default {
if (this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex) {
selectedData = this.$refs.groundingIndexTable.mutiSelectArr.groundingIndex;
}
const sceneType = selectedData.map((v) => {
return v.sceneType;
const baseSceneObj = selectedData.map((v) => {
return v.baseSceneCode
}) || [];
if (!selectedData.length)
return this.$message.warning("请选择上架记录");
if (Array.from(new Set(sceneType))?.length > 1) {
console.log(baseSceneObj)
const baseSceneArr = Array.from(new Set(baseSceneObj))
if (baseSceneArr?.length > 1) {
return this.$message.warning("请选择同一业务场景的上架记录");
}
this.batchCopySelectData = selectedData || [];
this.batchCopySelectScene = Array.from(new Set(sceneType))[0];
this.batchCopySelectSceneObj = {baseSceneCode: baseSceneArr[0], name: this.baseData.baseSceneList?.find(val => val.baseSceneCode == baseSceneArr[0])?.name};
this.batchCopyVisible = true;
},
// 批量复制弹窗确定
......
......@@ -96,7 +96,7 @@
:rules="rules[item.name]"
style="margin-bottom: 0">
<div>
<span>{{ item.unit ? priceFilter(ele[item.name]) : (ele[item.name]) }}</span>
<span>{{ item.unit || item.type == 'price' ? priceFilter(ele[item.name]) : (ele[item.name]) }}</span>
<span v-if="item.name == 'minSellPrice'">{{ ele.validMinSellPrice == 'Y' ? '(校验最低价)' : '(不校验最低价)' }}</span>
</div>
</el-form-item>
......
......@@ -8,6 +8,7 @@
:form-ref="proFormRef"
:goods-select-list="goodsSelectList"
:origin-data="editData"
:sceneCodeList="sceneCodeList"
:position-type-list="positionTypeList"
@handleAddConfirm="handleAddConfirm"
@handleClose="handleAddClose">
......@@ -17,9 +18,11 @@
</template>
<script>
import { getOperationCost } from "@api/grounding";
import { addOrUpdatePackage, getPackageDetailInfo } from "@api/packageManage";
import { getBaseSceneCodeList } from "@api/productManage";
import { mapActions } from "vuex";
import { BaseData, sceneCodeList } from "@/common/constants.js";
import { BaseData } from "@/common/constants.js";
import { deepClone } from "@/common/util";
import { baseConfig } from "@/main";
import { convertYuanToWan, filterSpecsStr } from "../filterOption";
......@@ -140,14 +143,15 @@ export default {
}, {
title: "门店信息",
formBlock: [{
name: "sceneType",
name: "baseSceneCode",
label: "业务场景",
isRequired: true,
type: "select",
isClear: false,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionId: "baseSceneCode",
optionScene: "sceneType",
optionLabel: "name",
width: "432px",
}, {
name: "merchantGoodsRefList",
......@@ -177,7 +181,7 @@ export default {
financeCheckFlag: "N", // 财务规则校验
groundingGoodsList: [{ // 上架产品集合
upgradeGoodsId: "", // 产品id
goodsAlias: "", // 产品别名
goodsAlias: "", // 商品别名
position: "", // 上架部位
sellPrice: "", // 参考售价
minSellPrice: "", // 最低售价
......@@ -201,48 +205,58 @@ export default {
};
},
mounted() {
this.getBaseData();
const id = this.$route.query.id;
if (!id) {
this.$nextTick(() => {
this.show = true;
});
} else {
this.addOrEdit = "edit";
// 获取产品详情
this.getDetailInfo(id);
}
this.initData();
},
methods: {
...mapActions({
get: "d2admin/base/get",
close: "d2admin/page/close",
}),
initData() {
// 获取业务场景数据
getBaseSceneCodeList({}).then((res) => {
this.sceneCodeList = res || [];
this.getBaseData();
const id = this.$route.query.id;
if (!id) {
this.$nextTick(() => {
this.show = true;
});
} else {
this.addOrEdit = "edit";
// 获取产品详情
this.getDetailInfo(id);
}
});
},
async getBaseData() {
this.editForm.forEach((item) => {
item.formBlock && item.formBlock.forEach((v) => {
if (v.name == "sceneType") { // 业务场景
v.optionList = sceneCodeList;
if (v.name == "baseSceneCode") { // 业务场景
v.optionList = this.sceneCodeList;
}
});
});
this.positionTypeList = await this.get(BaseData.positionTypeList);
},
getDetailInfo(id) {
getPackageDetailInfo({ id }).then((res) => {
console.log(res, "getPackageDetailInfo");
getPackageDetailInfo({ id }).then(async (res) => {
res.groundingGoodsList = [];
res?.merchantGoodsInfoList?.forEach((val) => {
for (const val of (res?.merchantGoodsInfoList || [])) {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo || {};
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName];
const result = types.filter(type => type).join("-");
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({
id: val.id,
goodsType: val?.goodsType, // 类目值
upgradeGoodsId: val?.upgradeGoodsId, // 升级产品Id
goodsAlias: val?.goodsAlias, // 产品别名
goodsAlias: val?.goodsAlias, // 商品别名
position: val?.position, // 上架部位
positionNamesArr, // 多部位数组
sellPrice: val?.sellPrice, // 售价
......@@ -273,9 +287,10 @@ export default {
specificationData: this.filterSpecsStr(val?.upgradeGoods),
carTypeConfigName: val?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join("/"),
upgradeCommodityCode: val?.upgradeCommodityCode,
operationCost: costResult?.operationCost,
},
});
});
}
res.financeCheckFlag = res?.financeCheckFlag;
res.voucherList.forEach((val) => { // 处理上传进度 默认进度100%
if (val.voucherFileUrl)
......@@ -306,6 +321,12 @@ export default {
const { num } = data;
this.confirm(num, data);
},
filterBaseSceneCodeBySceneType(targetTypes) {
const types = [].concat(targetTypes)
return this.sceneCodeList?.flatMap(val =>
types.includes(val.sceneType) ? [val.baseSceneCode] : []
) || []
},
confirm(num, data) {
// 1保存并上架 2存草稿
const formObj = {};
......@@ -320,7 +341,6 @@ export default {
// 从 RelateStoreTable 组件获取用户操作后的库存模式数据
const tableData = this.$refs.d2GroundingForm ? this.$refs.d2GroundingForm.getRelateStoreTableData() : [];
const merchantGoodsMap = {};
console.log(tableData, "tableData");
// 根据商户Id分组数据
tableData.forEach((item) => {
if (!merchantGoodsMap[item.merchantId]) {
......@@ -343,7 +363,6 @@ export default {
for (let key in merchantGoodsMap) {
arr.push(merchantGoodsMap[key]);
}
console.log(arr, "arr");
const fileArr = [];
data?.voucherList?.forEach((val) => { // 处理上传凭证数据 删除或取消上传并不会删除数组 只是将url置空
......@@ -384,7 +403,7 @@ export default {
packageName: formObj?.packageName,
packageAlias: formObj?.packageAlias,
financeCheckFlag: formObj?.financeCheckFlag,
sceneType: formObj?.sceneType,
baseSceneCode: formObj?.baseSceneCode,
merchantGoodsRefList: arr,
voucherList: fileArr,
merchantGoodsInfoList,
......@@ -395,10 +414,10 @@ export default {
// 套餐总售价需大于零
if (formObj?.sellPrice <= 0)
return this.$message.warning("套餐总售价需大于零,请检查套餐包含产品售价");
if (merchantGoodsInfoList?.findIndex(v => this.membraneTypeList.includes(v.goodsType)) > -1 && data?.sceneType != 1)
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 && data?.sceneType != 0)
return this.$message.warning("延保、权益类产品仅支持上架会员权益场景");
if (this.extendedPosiType.includes(data.goodsType) && !this.filterBaseSceneCodeBySceneType(0)?.includes(data?.baseSceneCode))
return this.$message.warning("延保类产品仅支持上架至延保&权益业务场景 ");
this.editData = data;
// 判断套餐的所有子产品适用车型是否存在交集(无适用车型默认为全部)
let seriesIdFlag = false;
......
......@@ -17,9 +17,14 @@
@input="matchPackageCodeInput" />
</template>
<template #applicableAreaSelect>
<ApplicableAreaSelect v-model="searchForm.applicableArea"
<!-- <ApplicableAreaSelect v-model="applicableAreas"
:options="baseData.applicableAreaList"
width="100%" />
width="100%"
@selection-change="handleAreaSelectChange" /> -->
<ApplicableAreaQuerySelect v-model="applicableAreas"
:options="baseData.applicableAreaList"
width="100%"
@change="val => handleAreaSelectChange(val)" />
</template>
</d2-search>
<div class="up-btns">
......@@ -164,14 +169,16 @@ import { batchCheckPackage, delPackageById, getPackageManageList, upOrDownPackag
import { mapActions, mapState } from "vuex";
import { BaseData, sceneCodeList, sceneList } from "@/common/constants.js";
import { deepClone, Util } from "@/common/util";
import ApplicableAreaSelect from "@/views/goods/components/applicable-area-select/index.vue";
// import ApplicableAreaSelect from "@/views/goods/components/applicable-area-select/index.vue";
import BatchModifyPackageInventoryDialog from "./components/BatchModifyPackageInventoryDialog.vue";
import { getBaseSceneCodeList, getAreaDataList } from "@api/productManage"
import ApplicableAreaQuerySelect from '@/views/goods/components/applicable-area-query-select/index.vue'
export default {
name: "PackageManage",
components: {
ApplicableAreaSelect,
// ApplicableAreaSelect,
BatchModifyPackageInventoryDialog,
ApplicableAreaQuerySelect
},
data() {
return {
......@@ -183,12 +190,11 @@ export default {
matchPackageCode: "",
merchantId: "",
yqMerchantId: "",
sceneType: "",
baseSceneCodeList: "",
status: "",
goodsSource: 0,
financeCheckFlag: "",
inventoryType: "",
applicableArea: [],
inventoryType: ""
},
getListApi: getPackageManageList,
showFormData: [{
......@@ -227,12 +233,12 @@ export default {
optionsName: "yqMerchantServiceList",
}, {
label: "业务场景",
name: "sceneType",
name: "baseSceneCodeList",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "sceneCodeList",
optionId: "baseSceneCode",
optionLabel: "name",
optionsName: "baseSceneList",
}, {
label: "状态",
name: "status",
......@@ -366,10 +372,10 @@ export default {
width: 100,
}, {
label: "业务场景",
prop: "sceneType",
formatter: (cellValue) => {
return sceneList[cellValue.sceneType] || "-";
},
prop: "baseSceneName",
// formatter: (cellValue) => {
// return this.baseData.baseSceneList[cellValue.sceneType] || "-";
// },
width: 130,
}, {
label: "状态",
......@@ -442,14 +448,16 @@ export default {
confValue: "虚拟",
},
],
baseSceneList: []
},
applicableAreas: []
};
},
mounted() {
let allOpt = { confId: "", confValue: "全部" };
this.baseData.statusList.unshift(allOpt);
this.baseData.sceneCodeList = deepClone(sceneCodeList);
this.baseData.sceneCodeList.unshift(allOpt);
// this.baseData.sceneCodeList = deepClone(sceneCodeList);
// this.baseData.sceneCodeList.unshift(allOpt);
this.baseData.financeCheckFlagList.unshift(allOpt);
this.getApplicableArea();
// 获取园区店
......@@ -466,6 +474,10 @@ export default {
this.baseData.merchantServiceList = res;
this.getOptionsList();
});
// 获取适用区域
this.getApplicableArea();
// 获取业务场景数据
this.getBaseCodeList()
},
computed: {
...mapState({
......@@ -483,6 +495,17 @@ export default {
this.baseData.applicableAreaList = Array.isArray(res) ? res : [];
});
},
getBaseCodeList() {
getBaseSceneCodeList({}).then(res => {
this.baseData.baseSceneList = res || []
this.getOptionsList()
})
},
getApplicableArea() {
getAreaDataList({}).then(res => {
this.baseData.applicableAreaList = res || []
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
......@@ -509,6 +532,9 @@ export default {
return "-";
return (Math.round(num * pow) / pow).toFixed(2);
},
handleAreaSelectChange(data) {
this.searchForm.cityCodeList = data?.map(val => { return val.cityCode })
},
handleReset() {
this.searchForm = {
packageName: "",
......@@ -516,12 +542,13 @@ export default {
matchPackageCode: "",
merchantId: "",
yqMerchantId: "",
sceneType: "",
baseSceneCodeList: "",
status: "",
goodsSource: 0,
financeCheckFlag: "",
inventoryType: "",
};
this.applicableAreas = []
// 重新查询
this.$refs.packageIndexTable.refreshTable(true, true);
},
......@@ -692,6 +719,13 @@ export default {
// 导出
handleExport() {
let params = deepClone(this.searchForm);
if (params?.cityCodeList?.length) {
params.cityCodeList.forEach((item, index) => {
const name = `cityCodeList[${index}]`
params[name] = item
})
}
delete params.cityCodeList
params.method = "dj.api.smartcarlife.merchantPackageGoodsInfo.export.Async";
let [merchantIdList, yqMerchantIdList] = [[], []];
merchantIdList = [params.merchantId] || undefined;
......
......@@ -17,6 +17,7 @@ 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: {
......@@ -28,7 +29,7 @@ export default {
rules: {
merchantGoodsRefList: [{ required: true }],
packageName: [{ required: true }],
sceneName: [{ required: true }],
baseSceneName: [{ required: true }],
positionStr: [{ required: true }],
upgradeGoodsName: [{ required: true }],
sellPrice: [{ required: true }],
......@@ -93,7 +94,7 @@ export default {
}, {
title: '门店信息',
formBlock: [{
name: 'sceneName',
name: 'baseSceneName',
label: '业务场景'
}, {
name: 'merchantGoodsRefList',
......@@ -139,7 +140,7 @@ export default {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
getDetailInfo(id) {
getPackageDetailInfo({ id }).then(res => {
getPackageDetailInfo({ id }).then(async res => {
res.reviewLogList?.forEach(val => {
val.updatedDateStr = val.updatedDate ? Util.dateFormate(val.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
})
......@@ -148,7 +149,7 @@ export default {
arr = crowdUpgradeSupplyModeList
}
res.groundingGoodsList = []
res?.merchantGoodsInfoList?.forEach(val => {
for (const val of (res?.merchantGoodsInfoList || [])) {
if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList
}
......@@ -158,7 +159,9 @@ export default {
this.editForm[1].formBlock.push(packageGoodsDetail)
// 太阳膜类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || []
res.groundingGoodsList.push({
// 实时计算运营成本
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 || '-', // 商品别名
......@@ -183,17 +186,18 @@ export default {
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)}万` : ''}`
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
upgradeCommodityCode: val?.upgradeCommodityCode,
operationCost: costResult?.operationCost
}
})
})
res.sceneName = sceneList[res.sceneType] || '-'
}
res.baseSceneName = res.baseSceneName || '-'
res.financeCheckFlagStr = res.financeCheckFlag == 'Y' ? '开启' : res.financeCheckFlag == 'N' ? '关闭' : '-'
res.merchantGoodsRefList = res.merchantGoodsRefList || []
res.voucherList = res?.voucherList || []
......
......@@ -36,7 +36,7 @@
import { mapActions, mapMutations, mapState } from 'vuex'
import productEditorDialog from './productEditorDialog.vue'
import publishProductDialog from './publishProductDialog.vue'
import { getGroundingManageList } from '@api/grounding'
import { getProductCatalogList, deleteProductCatalog } from '@api/productManage'
import { deepClone } from '@/common/util'
export default {
name: 'ProductCatalog',
......@@ -50,7 +50,7 @@ export default {
productName: '',
productCode: ''
},
getListApi: getGroundingManageList,
getListApi: getProductCatalogList,
showFormData: [
{
label: '产品编码',
......@@ -97,23 +97,23 @@ export default {
},
{
label: '产品名称',
prop: 'baseGoodsName'
prop: 'productName'
},
{
label: '产品编码',
prop: 'type'
prop: 'productCode'
},
// {
// label: '计价单位',
// prop: 'priceUnitName'
// },
{
label: '计价单位',
prop: 'thirdPartyName'
label: 'SPU产品名称',
prop: 'spuGoodsNames'
},
{
label: 'SPU产品名称',
prop: 'thirdPartyCode'
},
{
label: '供应商',
prop: 'goodsTypeName'
label: '供应商',
prop: 'providerNames'
}
]
}
......@@ -121,9 +121,7 @@ export default {
},
computed: {
...mapState({
dowloadList: state => state.d2admin.user.dowloadList,
updateList: state => state.d2admin.user.updateList,
updateRefesh: state => state.d2admin.user.updateRefesh
dowloadList: state => state.d2admin.user.dowloadList
})
},
methods: {
......@@ -174,7 +172,7 @@ export default {
handleBatchGrounding() {
this.selectedList = this.getMutiDate()
if (this.selectedList.length == 0) {
this.$message.error('请选择要上架的产品')
this.$message.warning('请选择要上架的产品')
return
}
this.selectedProducts = deepClone(this.selectedList)
......@@ -189,12 +187,13 @@ export default {
},
publishConfirm(data) {
this.publishProductVisible = false
const id = data && data.baseGoodsId
const id = data && data.baseGoodsId
const skuData = data?.selectedProducts?.map(val => {
return {
specificationData: val.name,
type: val.type,
priceUnitType: val.priceUnitType
specificationData: val.productName,
type: val.productCode,
priceUnitType: val.priceUnitType,
productTemplateId: val.id
}
})
if (id) {
......@@ -230,14 +229,28 @@ export default {
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$message({
type: 'success',
message: '删除成功!'
})
.then(() => {
deleteProductCatalog({ id: row.id }).then(res => {
this.$message.success('删除成功')
this.$refs.productCatalogTable?.refreshTable(true, true)
})
})
.catch(() => {})
}
},
handleExportProductCatalog() {
const params = { ...this.searchForm };
params.method = "dj.api.smartcarlife.productTemplate.export.async";
const list = [
...this.dowloadList,
{
name: "基础商品列表",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime(),
},
];
this.actionSetDownloadList({ list, type: "dowloadList" });
}
}
}
</script>
......
......@@ -2,12 +2,14 @@
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" @handleClick="handleAddConfirm">
<div class="detail-dialog">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="110px" :is-block="true" form-ref="editChildRef" :form-obj="infoForm" :form-data="productFormData" :form-rules="formRules"></glsx-combi-form>
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="110px" :is-block="true" form-ref="editChildRef" :form-obj="info" :form-data="productFormData" :form-rules="formRules"></glsx-combi-form>
</div>
</baseDialog>
</template>
<script>
import { priceUnitTypeList } from '@/common/constants.js'
// import { priceUnitTypeList } from '@/common/constants.js'
import { deepClone } from '@/common/util';
import { addOrUpdateProductCatalog } from '@api/productManage'
export default {
name: 'ProductEditorDialog',
props: {
......@@ -29,18 +31,18 @@ export default {
},
data() {
return {
productFormData: {
productCode: '',
productName: '',
priceUnit: ''
},
formRules: {
productCode: [{ required: true, message: '请输入产品编码', trigger: 'blur' }],
productName: [{ required: true, message: '请输入产品名称', trigger: 'blur' }],
priceUnit: [{ required: true, message: '请选择计价单位', trigger: 'change' }]
},
// priceUnitType: [{ required: true, message: '请选择计价单位', trigger: 'change' }]
},
info: {
productName: '',
productCode: '',
priceUnitType: ''
},
baseData: {
priceUnitList: priceUnitTypeList
// priceUnitList: priceUnitTypeList
},
productFormData: [
{
......@@ -55,15 +57,15 @@ export default {
type: 'input',
maxlength: 50
},
{
label: '计价单位',
name: 'priceUnit',
type: 'select',
optionList: [],
optionId: 'value',
optionLabel: 'label',
optionsName: 'priceUnitList'
}
// {
// label: '计价单位',
// name: 'priceUnitType',
// type: 'select',
// optionList: [],
// optionId: 'value',
// optionLabel: 'label',
// optionsName: 'priceUnitList'
// }
]
}
},
......@@ -82,7 +84,7 @@ export default {
},
mounted() {
this.getOptions()
console.log('infoForm', this.infoForm)
this.info = { ...this.info, ...deepClone(this.infoForm) }
},
methods: {
getOptions() {
......@@ -97,12 +99,19 @@ export default {
this.$refs.editFormRef?.clearValidate()
},
// 确定
handleAddConfirm() {
console.log(this.$refs.editFormRef?.$refs.editChildRef)
this.$refs.editFormRef?.$refs.editChildRef.validate(valid => {
if (valid) {
this.$message.success('操作成功')
this.$emit('dialogClose')
handleAddConfirm() {
let _this = this
_this.$refs.editFormRef?.$refs.editChildRef.validate(valid => {
if (valid) {
let params = {
id: _this.info?.id,
productName: _this.info?.productName,
productCode: _this.info?.productCode
}
addOrUpdateProductCatalog(params).then(res => {
_this.$message.success(`${params.id ? "修改" : "新增"}成功`)
_this.$emit('dialogClose')
})
}
})
}
......
......@@ -49,10 +49,10 @@
max-height="240"
class="selected-product-table">
<el-table-column label="产品名称"
prop="goodsName"
prop="productName"
show-overflow-tooltip />
<el-table-column label="产品编码"
prop="goodsCode"
prop="productCode"
show-overflow-tooltip />
</el-table>
</div>
......@@ -61,7 +61,8 @@
</template>
<script>
import { getProductManageList } from "@api/productManage";
import { getList } from "@api/product";
import { getProductManageList } from "@api/productManage"
export default {
name: "PublishProduct",
......@@ -199,17 +200,33 @@ export default {
}, 10);
},
getSPUList() {
getProductManageList({
getList({
goodsName: this.searchGoodsName,
specificationType: 1,
currentPage: this.SPUCurrentPage,
pageSize: 20,
}).then((res) => {
}).then(res => {
res?.list?.forEach((val) => {
val.baseGoodsName = val?.goodsInfo?.goodsName;
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val || {};
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName];
val.baseGoodsName = `${val?.goodsName}/${types.filter(t => t).join("-")}${val?.providerName ? '/' + val.providerName : ''}`;
val.id = val?.baseGoodsId
});
this.SPUOptionsList = this.SPUOptionsList.concat(res.list);
this.SPUAllPages = res.totalPage;
});
})
// getProductManageList({
// goodsName: this.searchGoodsName,
// specificationType: 1,
// currentPage: this.SPUCurrentPage,
// pageSize: 20,
// }).then((res) => {
// res?.list?.forEach((val) => {
// val.baseGoodsName = val?.goodsInfo?.goodsName;
// });
// this.SPUOptionsList = this.SPUOptionsList.concat(res.list);
// this.SPUAllPages = res.totalPage;
// });
},
handleAddConfirm() {
this.$refs.formRef.validate((valid) => {
......
......@@ -43,7 +43,7 @@
</p>
<p class="item_class">
<span class="label">供应商:</span>
<span class="value">{{ formatAccessoryType($$(commodityInfo.goodsInfo, 'accessoryType')) }}</span>
<EllipsisPopover class="value" :content="$$(commodityInfo.goodsInfo, 'providerName') || '-'"></EllipsisPopover>
</p>
<p class="item_class">
<span class="label">供应方:</span>
......@@ -76,7 +76,7 @@
<EllipsisPopover :content="item.carSeriesName || '-'"></EllipsisPopover>
</el-form-item>
<el-form-item class="d2-drawer-item" label="运营成本/元:">
<EllipsisPopover :content="!filterEmpty(item.upgradePrice) ? priceFilter(item.upgradePrice) : '-'"></EllipsisPopover>
<EllipsisPopover :content="!filterEmpty(item.operationCost) ? priceFilter(item.operationCost) : '-'"></EllipsisPopover>
</el-form-item>
</div>
</el-form>
......@@ -109,7 +109,6 @@ import { baseConfig } from '@/main'
import ellipsisPopover from '@/views/goods/components/ellipsisPopover.vue'
import { convertYuanToWan, filterSpecsStr } from '@/views/goods/filterOption'
// import D2Table from "@/components/d2-table/index.vue";
export default {
name: 'DrawerDetail',
components: { EllipsisPopover: ellipsisPopover },
......@@ -182,7 +181,7 @@ export default {
html: true,
formatter: row => this.formatNameValueHtml(row.newValue)
},
{ label: '字段', prop: 'type', minWidth: 100, formatter: row => row.type ?? '-' },
{ label: '产品编码', prop: 'type', minWidth: 100, formatter: row => row.type ?? '-' },
{ label: 'ID', prop: 'commodityCode', minWidth: 100, formatter: row => row.commodityCode ?? '-' },
{ label: '操作人', prop: 'updatedBy', minWidth: 100 },
{
......@@ -192,7 +191,7 @@ export default {
formatter: row => (row.updatedDate ? Util.dateFormate(row.updatedDate, 'YYYY-MM-DD HH:mm:ss') : '-')
}
]
}
}
}
},
computed: {
......@@ -229,13 +228,13 @@ export default {
},
mounted() {
this.loadSkuData()
this.loadSkuData()
},
methods: {
formatAccessoryType(val) {
return val === 1 ? '原厂件' : val === 2 ? '品牌件' : '-'
},
},
getPriceUnitLabel(item) {
if (item.priceUnitName) return item.priceUnitName
......@@ -268,7 +267,7 @@ export default {
handleCurrentChange(val) {
this.pagination.currentPage = val
this.loadSkuData()
},
},
loadSkuData() {
if (!this.commodityInfoId) return
......@@ -280,7 +279,7 @@ export default {
currentPage: this.pagination.currentPage
}
getBaseGoodsSkuPageById(params)
.then(res => {
.then(res => {
this.commodityInfo = res || {}
const pageData = res?.upgradeGoodsPage || res
const list = pageData?.list || res?.upgradeGoodsList || []
......@@ -301,7 +300,7 @@ export default {
?.map(v => {
return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}${v.serviceItemId ? `/${convertYuanToWan(v.minPrice)}-${convertYuanToWan(v.maxPrice)}万` : ''}`
})
?.join(',')
?.join(',')
item.extendServiceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => v.serviceName)?.join(',')
item.carSeriesName = item?.carTypeConfigList?.map(v => v.seriesName)?.join('/') || ''
if (!item.goodsInfo) item.goodsInfo = {}
......@@ -425,6 +424,13 @@ export default {
margin-top: 10px;
display: flex;
justify-content: space-between;
.item_class {
flex: 1;
display: flex;
.value {
width: calc(100% - 70px);
}
}
}
}
.child-drawer-block {
......
......@@ -39,7 +39,7 @@
</p>
<p class="item_class">
<span class="label">供应商:</span>
<span class="value">{{ formatAccessoryType($$(commodityInfo.goodsInfo, "accessoryType")) }}</span>
<EllipsisPopover class="value" :content="$$(commodityInfo.goodsInfo, 'providerName') || '-'"></EllipsisPopover>
</p>
<p class="item_class">
<span class="label">供应方:</span>
......@@ -62,7 +62,7 @@
<EllipsisPopover :content="item.specificationName || '-'"></EllipsisPopover>
</el-form-item>
<el-form-item class="d2-drawer-item"
label="编码:">
label="产品编码:">
<EllipsisPopover :content="item.type || '-'"></EllipsisPopover>
</el-form-item>
<el-form-item class="d2-drawer-item"
......@@ -86,7 +86,7 @@
<EllipsisPopover :content="item.carSeriesName || '-'"></EllipsisPopover>
</el-form-item>
<el-form-item class="d2-drawer-item" label="运营成本/元:">
<EllipsisPopover :content="!filterEmpty(item.upgradePrice) ? priceFilter(item.upgradePrice) : '-'"></EllipsisPopover>
<EllipsisPopover :content="!filterEmpty(item.operationCost) ? priceFilter(item.operationCost) : '-'"></EllipsisPopover>
</el-form-item>
</div>
</el-form>
......@@ -123,7 +123,7 @@
<span v-html="formatNameValueHtml(scope.row.newValue)"></span>
</template>
</el-table-column>
<el-table-column label="字段"
<el-table-column label="产品编码"
min-width="100"
prop="type">
<template #default="scope">
......@@ -397,6 +397,13 @@ export default {
margin-top: 10px;
display: flex;
justify-content: space-between;
.item_class {
flex: 1;
display: flex;
.value {
width: calc(100% - 70px);
}
}
}
.item_class {
margin: 0;
......
......@@ -152,16 +152,16 @@ export default {
async getBaseData() {
},
getGoodsInfo(query) {
getGoodsInfoById({ id: query?.id }).then(res => {
getGoodsInfoById({ id: query?.id }).then(res => {
const specificationDetailList = []
let objData = {}
this.copyUpgradeGoodsList = deepClone(res.upgradeGoodsList).map((val, index) => {
val?.upgradeGoodsServiceItemsList?.forEach(v => {
v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}${v.serviceItemId ? `/${convertYuanToWan(v.minPrice)}-${convertYuanToWan(v.maxPrice)}万` : ''}`
v.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}${v.serviceItemId ? `/${v.serviceItemId}` : ''}`
v.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}${v.serviceItemId ? `/${v.serviceItemId}` : ''}`
})
const priceUnitType = val.priceUnitType ?? priceUnitTypeList.find(o => o.label === val.priceUnitName)?.value ?? null
const priceUnitName = val.priceUnitName ?? priceUnitTypeList.find(o => o.value === val.priceUnitType)?.label ?? ''
const priceUnitName = val.priceUnitName ?? priceUnitTypeList.find(o => o.value === val.priceUnitType)?.label ?? ''
return {
id: val.id,
specificationData: val.specificationData,
......@@ -174,8 +174,8 @@ export default {
purchaseCost: val.purchaseCost,
operationCoefficient: val.operationCoefficient,
operationCost: val.operationCost,
applicableArea: val.applicableArea?.map(val => {return [val.provinceCode, val.cityCode]}) || [],
accessoryType: val.accessoryType,
upgradeGoodsAreaList: val?.upgradeGoodsAreaList || [],
accessoryType: val.accessoryType,
upgradePrice: val.upgradePrice,
warningValue: val.warningValue,
warningValueMax: val.warningValueMax,
......@@ -204,10 +204,13 @@ export default {
seriesId: v.seriesId,
seriesName: v.seriesName
}
}),
}),
customerLabel: val?.customerLabel,
supplySource: val?.supplySource ? val?.supplySource?.split(',') : [],
remark: val.remark,
checked: false
}
})
})
// 从产品清单上架产品带入数据
if (query?.skuData?.length) this.addToUpgradeGoodsList(query?.skuData, res?.goodsInfo)
res.goodsInfo.goodsSource = 0
......@@ -236,7 +239,8 @@ export default {
v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}${v.serviceItemId ? `/${convertYuanToWan(v.minPrice)}-${convertYuanToWan(v.maxPrice)}万` : ''}`
v.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}${v.serviceItemId ? `/${v.serviceItemId}` : ''}`
return v
})
})
val.supplySource = val?.supplySource ? val?.supplySource?.split(',') : []
return val
}),
goodsSpecificationList: deepClone(this.copyUpgradeGoodsList),
......@@ -250,10 +254,10 @@ export default {
merchantGoodsInfos: res?.merchantGoodsInfos,
scrmFlag: res?.goodsInfo?.scrmFlag,
accessoryType: res.goodsInfo?.accessoryType,
}
providerId: res.goodsInfo?.providerId
}
this.productFormData = deepClone({ ...res.goodsInfo, status: res?.status, oldconvertedValue: res.goodsInfo?.convertedValue, tempGoodsType, secondaryGoodsType: res.goodsInfo.secondaryGoodsType, thirdLevelGoodsType: res.goodsInfo.thirdLevelGoodsType }) || {}
this.setUpdateGoodsInfo(objData)
this.setUpdateGoodsInfo(objData)
this.show = true
// 保留一份类目和供应方,广联直营的延保商品并且不是SCRM同步过来的,页面不能提交修改
this.pageDisabled = this.extendedPosiType.includes(res?.goodsInfo?.goodsType) && !this.baseConfig.supplierCode.includes(res?.goodsInfo?.supplierCode) && res?.goodsInfo?.scrmFlag != 'Y'
......@@ -342,11 +346,12 @@ export default {
thirdPartyName: item.thirdPartyName,
thirdPartyCode: item.thirdPartyCode,
priceUnitType: item.priceUnitType,
priceUnitName: item.priceUnitName,
priceUnitName: item.priceUnitName,
productTemplateId: item?.productTemplateId,
purchaseCost: item.purchaseCost,
operationCoefficient: item.operationCoefficient,
operationCost: item.operationCost,
applicableArea: item.applicableAreaCodePairs,
upgradeGoodsAreaList: item.upgradeGoodsAreaList || [],
accessoryType: item.accessoryType,
warningValue: item.warningValue,
warningValueMax: item.warningValueMax,
......@@ -354,8 +359,8 @@ export default {
entityCardFlag: this.equitySceneType.includes(productFormData?.goodsType) ? (item.entityCardFlag ? 'Y' : 'N') : '', // 是否实体卡
djCost: this.equitySceneType?.concat(this.extendedPosiType)?.includes(productFormData?.goodsType) && !this.baseConfig.supplierCode.includes(`${productFormData.supplierCode}`) ? item.djCost : '',
carTypeConfigList: item.selectCarSerise,
customerTag: item.customerTag,
supplySource: item.supplySource,
customerLabel: item.customerLabel,
supplySource: item.supplySource?.length ? item.supplySource?.join(',') : '',
remark: item.remark
})
})
......@@ -419,7 +424,7 @@ export default {
purchaseCost: item.purchaseCost,
operationCoefficient: item.operationCoefficient,
operationCost: item.operationCost,
applicableArea: item.applicableAreaCodePairs,
upgradeGoodsAreaList: item.upgradeGoodsAreaList || [],
accessoryType: item.accessoryType,
warningValue: item.warningValue,
warningValueMax: item.warningValueMax,
......@@ -429,8 +434,8 @@ export default {
carTypeConfigList: item.selectCarSerise,
specificationNameSequence: goodsSpecificationNameList?.map(v => v.specificationName)?.join(';~;'),
specificationTypeSequence: goodsSpecificationNameList?.map(v => v.type)?.join(';~;'),
customerTag: item.customerTag,
supplySource: item.supplySource,
customerLabel: item.customerLabel,
supplySource: item.supplySource?.length ? item.supplySource?.join(',') : '',
remark: item.remark
})
}
......@@ -474,9 +479,7 @@ export default {
params?.goodsInfo?.goodsDescList.forEach((subVal, subIdx) => {
if (!subVal?.content) delete params.goodsInfo.goodsDescList[subIdx]
})
const requestEvent = this.addOrEdit == 'add' ? addProductManage : UpdateProductManage
console.log(params)
return
const requestEvent = this.addOrEdit == 'add' ? addProductManage : UpdateProductManage
requestEvent(params).then(res => {
this.notice.okTips()
// this.handleClose(true);
......@@ -529,11 +532,11 @@ export default {
}
return
}
const rowId = `row-${Date.now()}-${Math.random().toString(36).slice(2)}`
const rowId = raw?.productTemplateId
const operationCoefficient = isEquityOrExtend ? 1 : ''
const item = {
id: '',
rowId,
productTemplateId: rowId,
specificationData: specName,
specsValueList: specName ? `${specName}`.split(';~;') : [],
type,
......@@ -544,11 +547,9 @@ export default {
purchaseCost: '',
operationCoefficient,
operationCost: '',
applicableArea: [],
upgradeGoodsAreaList: [],
accessoryType,
upgradePrice: '',
customerTag: '',
supplySource: [],
djCost: '',
warningValue: '',
warningValueMax: '',
......@@ -559,7 +560,9 @@ export default {
entityCardFlag: false,
editGoodNameInput: false,
selectCarSerise: [],
checked: false,
checked: false,
customerLabel: '',
supplySource: [],
remark: '',
oldupgradePrice: '',
oldwarningValue: '',
......@@ -658,7 +661,7 @@ export default {
}
let specialList = []
// 1. 基础必填字段 产品编码、运营系数、运营成本、适用区域
const baseFields = ['specificationData', 'type', 'operationCoefficient', 'operationCost', 'applicableArea']
const baseFields = ['specificationData', 'type', 'operationCoefficient', 'operationCost', 'upgradeGoodsAreaList']
const { goodsType, supplierCode } = this.goodsInfoData
// 2. 权益/延保类
if (isEquityOrExtend) {
......@@ -674,7 +677,6 @@ export default {
specialList.push('priceUnitType', 'warrantyPeriod')
}
const requiredList = [...baseFields, ...specialList]
console.log(requiredList, this.goodsInfoData, confirmShopData)
// 将禁用的排除掉
let requiredConfirmShopData = deepClone(confirmShopData)?.filter(v => v.statusFlag != 2)
for (let i = 0; i < requiredConfirmShopData.length; i++) {
......@@ -695,7 +697,7 @@ export default {
{ key: 'purchaseCost', min: 0, max: 1000000, label: '采购成本' },
{ key: 'warrantyPeriod', min: 0, max: 100, label: '质保时间' },
{ key: 'operationCoefficient', min: 0.01, max: 100000, label: '运营系数' },
{ key: 'operationCost', min: 0.01, max: 100000, label: '运营成本' }
{ key: 'operationCost', min: 0, max: 100000, label: '运营成本' }
]
const listToCheck = this.goodsInfoData.specificationType == 1 ? this.goodsInfoData.goodsSpecificationSingleList : this.goodsInfoData.goodsSpecificationList
let hasRangeError = false
......
......@@ -160,11 +160,11 @@ export default {
}
</script>
<style lang="scss" scoped>
.relateService .table {
.table {
margin: 0 auto 20px !important;
width: 100%;
}
.relateService .tableCon {
.tableCon {
margin-top: 20px;
display: flex;
.tableBox {
......@@ -214,18 +214,18 @@ export default {
}
}
}
.service-service .relateService .el-table .cell,
.d2-form .relateService .el-table .cell {
.el-table .cell,
.el-table .cell {
line-height: 26px !important;
}
.service-service .relateService .el-table--medium td,
.d2-form .relateService .el-table--medium td {
::v-deep .el-table--medium td,
::v-deep .el-table--medium td {
padding: 6px 8px !important;
}
.relateService .red {
.red {
color: red;
}
.relateService .tip-icon {
.tip-icon {
position: absolute;
display: inline-block;
height: 10px;
......
......@@ -81,7 +81,7 @@
<script>
import { mapActions, mapGetters, mapMutations } from "vuex";
import { getExtendServiceItemsParts } from "@/api/productManage";
import { getExtendServiceItemsParts, getAreaDataList } from "@/api/productManage";
import { BaseData } from "@/common/constants.js";
import multipleSpecificationForm from "./multipleSpecificationForm.vue";
import singleSpecificationForm from "./singleSpecificationForm.vue";
......@@ -102,15 +102,15 @@ export default {
supplySourceOptions: [
{
label: "原厂",
value: 1,
value: '1',
},
{
label: "集采",
value: 2,
value: '2',
},
{
label: "店采",
value: 3,
value: '3',
},
],
applicableAreaList: [],
......@@ -141,55 +141,41 @@ export default {
});
},
getAreaList() {
// 假数据
this.applicableAreaList = [
{
label: "全国",
value: "ALL",
code: "ALL",
},
{
label: "北京市",
value: "110000",
code: "110000",
children: [
{ label: "北京市", value: "110100", code: "110100" },
],
},
"code": "110000",
"name": "北京市",
"level": 1,
"districts": [
{
label: "上海市",
value: "310000",
code: "310000",
children: [
{ label: "上海市", value: "310100", code: "310100" },
],
},
{
label: "广东省",
value: "440000",
code: "440000",
children: [
{ label: "广州市", value: "440100", code: "440100" },
{ label: "深圳市", value: "440300", code: "440300" },
],
},
{
label: "浙江省",
value: "330000",
code: "330000",
children: [
{ label: "杭州市", value: "330100", code: "330100" },
{ label: "宁波市", value: "330200", code: "330200" },
],
},
{
label: "新疆维吾尔自治区",
value: "331000",
code: "331000",
children: [
{label: "克孜勒苏柯尔克孜自治州", value: "331100", code: "331100"}
]
"code": "110100",
"name": "北京市",
"level": 2
}
]
}, {
"code": "130000",
"name": "河北省",
"level": 1,
"districts": [
{
"code": "130100",
"name": "石家庄市",
"level": 2
},
{
"code": "130200",
"name": "唐山市",
"level": 2
}
]
}
];
getAreaDataList({}).then(res => {
this.applicableAreaList = res || []
})
},
async getBaseData() {
this.productServiceItemList = await this.get(BaseData.productServiceItemList);
......
......@@ -62,7 +62,7 @@ export const packageGoodsForm = [{
label: '产品编码',
value: 'type'
}, {
label: '第三方编码',
label: '供应商编码',
value: 'thirdPartyCode'
}, {
label: '采购价',
......@@ -82,7 +82,7 @@ export const packageGoodsForm = [{
label: '所属分类',
value: 'tempGoodsTypeName'
}, {
label: '商品ID',
label: '产品ID',
value: 'upgradeCommodityCode'
}]
}, {
......@@ -186,7 +186,7 @@ export const packageGoodsDetail = [
label: '产品编码',
value: 'type'
}, {
label: '第三方编码',
label: '供应商编码',
value: 'thirdPartyCode'
}, {
label: '采购价',
......@@ -206,7 +206,7 @@ export const packageGoodsDetail = [
label: '所属分类',
value: 'tempGoodsTypeName'
}, {
label: '商品ID',
label: '产品ID',
value: 'upgradeCommodityCode'
}]
}, {
......
......@@ -56,7 +56,7 @@ export default {
label: '产品编码',
value: 'type'
}, {
label: '第三方编码',
label: '供应商编码',
value: 'thirdPartyCode'
}, {
label: '采购价',
......@@ -84,7 +84,7 @@ export default {
label: '所属分类',
value: 'tempGoodsTypeName'
}, {
label: '商品ID',
label: '产品ID',
value: 'upgradeCommodityCode'
}]
},
......
......@@ -61,7 +61,7 @@ export default {
label: '产品编码',
value: 'type'
}, {
label: '第三方编码',
label: '供应商编码',
value: 'thirdPartyCode'
}, {
label: '采购价',
......@@ -89,7 +89,7 @@ export default {
label: '所属分类',
value: 'tempGoodsTypeName'
}, {
label: '商品ID',
label: '产品ID',
value: 'upgradeCommodityCode'
}]
},
......@@ -158,7 +158,7 @@ export default {
// label: '产品编码',
// value: 'type'
// }, {
// label: '第三方编码',
// label: '供应商编码',
// value: 'thirdPartyCode'
// }, {
// label: '采购价',
......@@ -186,7 +186,7 @@ export default {
// label: '所属分类',
// value: 'tempGoodsTypeName'
// }, {
// label: '商品ID',
// label: '产品ID',
// value: 'upgradeCommodityCode'
// }]
// },
......
......@@ -238,7 +238,7 @@ export default {
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '商品ID',
label: '产品ID',
name: 'upgradeCommodityCode',
type: 'input',
isClear: true,
......@@ -250,7 +250,7 @@ export default {
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '第三方编码',
label: '供应商编码',
name: 'thirdPartyCode',
type: 'input',
isClear: true,
......@@ -311,7 +311,7 @@ export default {
}
},
{
label: '商品ID',
label: '产品ID',
prop: 'commodityCode',
parentProp: 'upgradeGoods',
width: 170
......@@ -326,7 +326,7 @@ export default {
// return cellValue.upgradeGoods.type || '-'
// }
}, {
label: '第三方编码',
label: '供应商编码',
prop: 'thirdPartyCode',
parentProp: 'upgradeGoods',
width: 100,
......
......@@ -212,12 +212,12 @@ export default {
listName: "list",
tableColumns: [
{
label: "商品名称",
label: "产品名称",
addHtml: "upgradeGoodsName",
prop: "upgradeGoodsName",
},
{
label: "商品编码",
label: "产品编码",
prop: "type",
},
{
......
......@@ -219,12 +219,12 @@ export default {
listName: "list",
tableColumns: [
{
label: "商品名称",
label: "产品名称",
addHtml: "upgradeGoodsName",
prop: "upgradeGoodsName",
},
{
label: "商品编码",
label: "产品编码",
prop: "type",
},
{
......
......@@ -211,12 +211,12 @@ export default {
listName: "list",
tableColumns: [
{
label: "商品名称",
label: "产品名称",
addHtml: "upgradeGoodsName",
prop: "upgradeGoodsName",
},
{
label: "商品编码",
label: "产品编码",
prop: "type",
},
{
......
......@@ -135,12 +135,12 @@ export default {
listName: "list",
tableColumns: [
{
label: "商品名称",
label: "产品名称",
addHtml: "upgradeGoodsName",
prop: "upgradeGoodsName",
},
{
label: "商品编码",
label: "产品编码",
prop: "type",
},
{
......
......@@ -248,11 +248,11 @@ export default {
listName: "list",
tableColumns: [
{
label: "商品名称",
label: "产品名称",
prop: "goodsName",
},
{
label: "商品编码",
label: "产品编码",
prop: "productCode",
},
{
......
......@@ -307,11 +307,11 @@ export default {
listName: "list",
tableColumns: [
{
label: "商品名称",
label: "产品名称",
prop: "goodsName",
},
{
label: "商品编码",
label: "产品编码",
prop: "productCode",
},
{
......
......@@ -317,11 +317,11 @@ export default {
listName: "list",
tableColumns: [
{
label: "商品名称",
label: "产品名称",
prop: "goodsName",
},
{
label: "商品编码",
label: "产品编码",
prop: "productCode",
},
{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!