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