Commit 2e5e3fda by Jaxon

Merge branch 'feature/d-plus-list-product' into 'SAAS+V5.7.1'

Feature/d plus list product

See merge request !583
2 parents 7837bf8c 2b2f560c
......@@ -29,7 +29,7 @@ export default antfu({
"array-bracket-spacing": ["error", "always"],
},
rules: {
"no-useless-catch": "warn",
"no-useless-catch": "off",
"vue/no-unused-refs": "warn",
"unused-imports/no-unused-imports": "warn",
"no-unused-vars": "warn",
......
......@@ -168,6 +168,12 @@ export default {
}
},
methods: {
blur() {
if (this.$refs.selectRef) {
console.log("使失焦?");
this.$refs.selectRef.blur();
}
},
async getApi(loadMore = false, isImmediate = false) {
this.loading = true;
try {
......
......@@ -80,7 +80,7 @@
</template>
<script>
import { brandList, findMerchantListByPage, getMerchantType, saveMerchant } from "@api/shelfManage";
import { findMerchantListByPage, brandList as getBrandListApi, getMerchantType as getMerchantTypeApi, saveMerchant } from "@api/shelfManage";
import { deepClone, Util } from "@/common/util";
import ProvinceCity from "@/components/province-city/index.vue";
import SelectBrand from "@/components/SelectBrand/index.vue";
......@@ -311,16 +311,13 @@ export default {
},
};
},
mounted() {
setTimeout(() => {
this.brandList();
}, 200);
async mounted() {
this.getOptionsList("editFormData", false);
this.getMerchantType();
this.getAccountLevel();
this.getChannel();
await this.getMerchantType();
await this.getAccountLevel();
await this.getChannel();
await this.brandList();
},
// 方法集合
methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
......@@ -422,68 +419,66 @@ export default {
handleClose() {
this.$emit("handleClose");
},
getMerchantType() {
async getMerchantType() {
const params = { dictType: "account_type" };
getMerchantType(params).then((res) => {
const list = ["4S店", "园区店", "服务商"];
this.baseData.merchantTypeList = [];
list.forEach((item) => {
let obj = res.find(k => k.dictLabel == item);
if (obj) {
this.baseData.merchantTypeList.push({
confId: obj.dictValue,
confLabel: obj.dictLabel,
});
}
});
this.editFormData[0].optionList = this.baseData.merchantTypeList;
const res = await getMerchantTypeApi(params);
const list = ["4S店", "园区店", "服务商"];
this.baseData.merchantTypeList = [];
list.forEach((item) => {
let obj = res.find(k => k.dictLabel == item);
if (obj) {
this.baseData.merchantTypeList.push({
confId: obj.dictValue,
confLabel: obj.dictLabel,
});
}
});
this.editFormData[0].optionList = this.baseData.merchantTypeList;
},
getAccountLevel() {
async getAccountLevel() {
const params = { dictType: "account_level" };
getMerchantType(params).then((res) => {
this.baseData.accountLevelList = res;
this.getOptionsList("editFormData", false, "merchantAccountLevel");
});
const res = await getMerchantTypeApi(params);
this.baseData.accountLevelList = res;
this.getOptionsList("editFormData", false, "merchantAccountLevel");
},
getChannel() {
async getChannel() {
const params = { dictType: "channel" };
getMerchantType(params).then((res) => {
this.baseData.channelList = res;
this.getOptionsList("editFormData", false, "channelId");
});
const res = await getMerchantTypeApi(params);
this.baseData.channelList = res;
this.getOptionsList("editFormData", false, "channelId");
},
checkBrandList() {
async checkBrandList() {
// let merchantBrandMain = chant.filter(item => item)
// this.$set(this.editData, 'merchantBrandMain', merchantBrandMain)
if (!this.editData.merchantBrandMain) {
this.editData.merchantBrandMain = [];
}
this.brandList();
await this.brandList();
// this.$refs.brandListTree.getCheckList(this.editData.merchantBrandMain)
},
brandList() {
async brandList() {
console.log("开始");
if (!this.$refs.brandListTree) {
return;
}
this.$refs.brandListTree.loading = true;
// const brandListTree = await brandList({})
brandList({}).then((res) => {
const brandListTree = res;
brandListTree.forEach((item) => {
let child = item.children;
if (!child)
return;
child.forEach((k) => {
delete k.children;
});
});
this.brandListTree = brandListTree;
this.$refs.brandListTree.getCheckList(this.editData.merchantBrandMain);
this.$nextTick(() => {
this.$refs.brandListTree.loading = false;
const res = await getBrandListApi({});
console.log("res", res);
const brandListTree = res;
brandListTree.forEach((item) => {
const child = item.children;
if (!child)
return;
child.forEach((k) => {
delete k.children;
});
});
this.brandListTree = brandListTree;
this.$refs.brandListTree.getCheckList(this.editData.merchantBrandMain);
this.$nextTick(() => {
this.$refs.brandListTree.loading = false;
});
},
// 点击主营品牌
clickBrand(val) {
......
......@@ -11,6 +11,8 @@
:show-business-line="false"
:show-sales-proportion-percent="false"
:show-settlement-type="false"
:show-gift-cost="false"
:show-penetration-rate="false"
use-parent-mode />
<el-divider class="divider"></el-divider>
</div>
......@@ -46,10 +48,13 @@ export default {
watch: {
packages: {
handler(val) {
this.packageData = val;
this.goodsList = val?.merchantGoodsInfoList;
const packages = cloneDeep(val);
this.packageData = packages;
console.log("packageData", this.packageData);
this.goodsList = packages?.merchantGoodsInfoList;
},
immediate: true,
deep: true,
},
},
mounted() {
......
......@@ -177,6 +177,7 @@
:show-business-line="false"
:show-sales-proportion-percent="false"
:show-settlement-type="false"
:show-penetration-rate="false"
use-remove-btn
@remove="handleRemoveProduct(goodsForm.id, index)" />
<el-divider v-if="index !== (goodsList.length - 1)" class="divider-product" />
......@@ -248,10 +249,12 @@ export default {
watch: {
packages: {
handler(val) {
this.packageForm = val;
this.goodsList = cloneDeep(val?.merchantGoodsInfoList);
const packages = cloneDeep(val);
this.packageForm = packages;
this.goodsList = packages?.merchantGoodsInfoList;
},
immediate: true,
deep: true,
},
// TODO: 如果有变动 需要 建议售价,最低售价,嘀加成本,第三方成本合计计算
// goodsList: {
......
......@@ -3,11 +3,9 @@
<div class="tabs-wrapper">
<Detail v-show="mode === VIEW_MODE.VIEW"
v-bind="$attrs"
:packages="localProduct"
v-on="$listeners" />
<Modify v-show="mode === VIEW_MODE.EDIT"
ref="modifyRef"
:packages="localProduct"
v-bind="$attrs"
v-on="$listeners" />
</div>
......@@ -32,26 +30,12 @@ export default {
type: String,
default: VIEW_MODE.VIEW,
},
packages: {
type: Object,
required: true,
},
},
data() {
return {
VIEW_MODE,
localProduct: {},
};
},
watch: {
packages: {
handler(val) {
this.$set(this, "localProduct", val);
},
immediate: true,
deep: true,
},
},
methods: {
async validate() {
const modifyRef = this.$refs.modifyRef;
......
<template>
<div class="detail-wrapper">
<Descriptions :data="product" :schema="formItems">
<Descriptions :data="localData" :schema="formItems">
<template #upgradeGoodsId-value>
<div class="sub-desc-wrapper">
<Descriptions :data="product" :schema="subFormItems" />
<Descriptions :data="localData" :schema="subFormItems" />
</div>
</template>
</Descriptions>
......@@ -41,12 +41,22 @@ export default {
type: Boolean,
default: true,
},
// 当套餐加载这个组件的时候 不需要赠送成本
showGiftCost: {
type: Boolean,
default: true,
},
// 当套餐加载这个组件的时候 不需要渗透率
showPenetrationRate: {
type: Boolean,
default: true,
},
},
data() {
return {
subFormItems: [],
schema: [],
localData: {},
};
},
computed: {
......@@ -61,10 +71,24 @@ export default {
if (item.name === "salesProportionPercent") {
return this.showSalesProportionPercent;
}
if (item.name === "giftCost") {
return this.showGiftCost;
}
if (item.name === "penetrationRate") {
return this.showPenetrationRate;
}
return true;
});
},
},
watch: {
product: {
handler(val) {
this.localData = cloneDeep(val);
},
immediate: true,
},
},
async mounted() {
this.schema = await productShelvingProductDetailFormItems();
this.subFormItems = await getProductShelvingProductDetailSubFormItems();
......
......@@ -95,7 +95,7 @@
</el-form-item>
</el-col>
<el-col v-if="isQualityUpgrade(sceneType)" :span="12">
<el-col v-if="isQualityUpgrade(sceneType) && showPenetrationRate" :span="12">
<el-form-item label="渗透率要求:" prop="penetrationRate">
<div class="form-item-append-fix">
<el-input-number v-model="formData.penetrationRate"
......@@ -264,6 +264,11 @@ export default {
type: Boolean,
default: true,
},
// 当套餐加载这个组件的时候 不需要渗透率
showPenetrationRate: {
type: Boolean,
default: true,
},
useRemoveBtn: {
type: Boolean,
default: false,
......
......@@ -412,6 +412,7 @@ export default {
// 获取 某个产品(可能是商品 或 套餐) 详情
async getProductPackageDetail(id) {
const res = await getProductPackagesApi({ id, businessCode: this.businessCode });
console.log("接口取到的值,", res);
return {
...res,
merchantGoodsInfoDTO: {
......
......@@ -161,7 +161,6 @@ export async function productShelvingProductDetailFormItems() {
render(h, { data }) {
return h(
"span",
`${isZeroOrNumber(data.salesProportionPercent)}%`,
);
},
......@@ -530,7 +529,7 @@ export const productShelvingComboDetailFormItems = [
render(h, { data }) {
return h(
"span",
data?.salesProportionPercent ? `${data.salesProportionPercent}%` : "-",
isZeroOrNumber(data?.salesProportionPercent) + "%",
);
},
},
......@@ -543,9 +542,11 @@ export const productShelvingComboDetailFormItems = [
return !(isQualityUpgrade(formModel.sceneType));
},
render(h, { data }) {
console.log("渗透率要求 传入的值", data.penetrationRate);
console.log("isZeroOrNumber(data?.penetrationRate) ", isZeroOrNumber(data?.penetrationRate));
return h(
"span",
data?.penetrationRate ? `${data.penetrationRate}%` : "-",
isZeroOrNumber(data?.penetrationRate) + "%",
);
},
},
......
......@@ -35,6 +35,7 @@
:data="table.data">
<el-table-column type="index"
label="序号"
:index=" index => index + (table.query.currentPage - 1) * table.query.pageSize + 1 "
align="center"
width="60px" />
<el-table-column prop="name"
......@@ -135,7 +136,7 @@
</el-table-column>
<el-table-column prop="firstLineSunshine2IncentiveFee"
label="一线阳光激励费2"
label="一线阳光2激励费"
width="165px"
align="center">
<template #default="{ row }">
......@@ -350,6 +351,9 @@ export default {
}
}
.el-table__body-wrapper {
td {
background-color: white;
}
.cell {
line-height: 48px;
}
......@@ -360,6 +364,9 @@ export default {
}
}
.el-table__fixed-body-wrapper {
td {
background-color: white;
}
.cell {
line-height: 48px;
}
......
......@@ -36,23 +36,25 @@ export default {
computed: {
getSchemaData() {
const data = {};
// 处理分账品类
const categoryTypeOpt = CategoryTypeOptions.find(o => o.value === this.localActiveRule.categoryType);
data.categoryType = { text: categoryTypeOpt ? categoryTypeOpt.label : "-" };
// 处理商品关系
let goodsStr = "-";
if (this.localActiveRule.goodsTypeGroupRelations && this.localActiveRule.goodsTypeGroupRelations.length) {
goodsStr = this.localActiveRule.goodsTypeGroupRelations.map((item) => {
if (this.localActiveRule.categoryType === 1)
return item.goodsTypeName || item.goodsType;
if (this.localActiveRule.categoryType === 2)
return `${item.upgradeGoodsName}(${item.commodityCode})`;
if (this.localActiveRule.categoryType === 3)
return `${item.packageName}(${item.packageCode})`;
return "-";
});
if (this.localActiveRule.groupType !== 1) {
// 处理分账品类
const categoryTypeOpt = CategoryTypeOptions.find(o => o.value === this.localActiveRule.categoryType);
data.categoryType = { text: categoryTypeOpt ? categoryTypeOpt.label : "-" };
// 处理商品关系
let goodsStr = "-";
if (this.localActiveRule.goodsTypeGroupRelations && this.localActiveRule.goodsTypeGroupRelations.length) {
goodsStr = this.localActiveRule.goodsTypeGroupRelations.map((item) => {
if (this.localActiveRule.categoryType === 1)
return item.goodsTypeName || item.goodsType;
if (this.localActiveRule.categoryType === 2)
return `${item.upgradeGoodsName}(${item.commodityCode})`;
if (this.localActiveRule.categoryType === 3)
return `${item.packageName}(${item.packageCode})`;
return "-";
});
}
data.goodsTypeGroupRelations = { text: goodsStr };
}
data.goodsTypeGroupRelations = { text: goodsStr };
// 处理平台方费用(temporaryArr)
if (this.temporaryArr && this.temporaryArr.length) {
......@@ -84,8 +86,10 @@ export default {
return data;
},
getSchema() {
const schema = [
{
const schema = [];
if (this?.localActiveRule?.groupType !== 1) {
schema.push({
descKey: "categoryType",
label: "分账品类",
labelWidth: "150px",
......@@ -94,8 +98,7 @@ export default {
const info = data[schemaItem.descKey];
return h("span", info ? info.text : "-");
},
},
{
}, {
descKey: "goodsTypeGroupRelations",
label: "商品",
labelWidth: "150px",
......@@ -106,12 +109,13 @@ export default {
return h("span", "-");
}
if (Array.isArray(info.text)) {
return h("div", info.text.map(text => h("div", text)));
return h("div", { class: "goods-relations-wrap" }, info.text.join(","));
}
return h("span", info.text);
},
},
];
});
}
// 动态添加平台方费用项
if (this.temporaryArr && this.temporaryArr.length) {
this.temporaryArr.forEach((item) => {
......@@ -191,4 +195,9 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .goods-relations-wrap {
white-space: normal;
word-break: break-all;
overflow-wrap: anywhere;
}
</style>
......@@ -6,7 +6,7 @@
size="small"
label-suffix=":"
label-width="154px">
<div style="display: flex">
<div v-if="classificationObj.groupType !== 1" style="display: flex">
<el-form-item label="分账品类"
prop="categoryType"
required>
......@@ -243,6 +243,10 @@ export default {
type: [String, Number],
require: true,
},
operationMode: {
type: Number,
require: true,
},
reconciliationRuleId: {
type: [String, Number],
......@@ -545,6 +549,15 @@ export default {
const valueItem = expenseCategoryRuleLevels.find(item => item.expenseCategoryId === temp.id);
temp.calculateMode = valueItem?.calculateMode || 1;
that.temporaryArr.push(temp);
// 人力成本 只有 运营模式 = 1 的时候才展示
if (temp.id === 807) {
if (this.operationMode === 1) {
that.temporaryArr.push(temp);
}
return;
}
that.temporaryArr.push(temp);
} else {
that.titleListPlatform.push(temp);
}
......
......@@ -9,9 +9,9 @@
:popper-append-to-body="false"
placeholder="请选择特殊品类"
@change="handleSpecialChange($event, false)">
<el-option v-for="(item, index) in specialCategory.list"
<el-option v-for="(item) in getSpecialCategoryList"
:key="item.id"
:label="item.title + (index + 1)"
:label="item.title"
:value="item.id">
<div class="tab-select-options-wrapper">
<span v-if="item.integrity === 'N'"
......@@ -20,7 +20,7 @@
style="color: #EB4E4E;">
</span>
<span class="label">
{{ item.title + (index + 1) }}
{{ item.title }}
</span>
<span v-if="useEdit && mode === VIEW_MODE.VIEW"
class="actions el-icon-close"
......@@ -62,11 +62,13 @@
<div v-if="goodsTypeGroupReconciliationRules && goodsTypeGroupReconciliationRules.length" class="content-wrapper">
<ClassificationDetail v-show="mode === VIEW_MODE.VIEW"
:operation-mode="operationMode"
:active-rule="goodsTypeGroupReconciliationRules[0]"
:query-fee-category-by-type-platform="options.platform" />
<ClassificationCpt v-show="mode === VIEW_MODE.EDIT"
ref="classificationRef"
:key="specialCategory.selectedIndex"
:operation-mode="operationMode"
:reconciliation-rule-id="reconciliationRuleId"
:merchant-id="specialCategory.detail.merchantId"
:query-fee-category-by-type-flow="options.flow"
......@@ -162,6 +164,13 @@ export default {
},
computed: {
getSpecialCategoryList() {
let index = 1;
return this.specialCategory.list.map(item => ({
...item,
title: item.groupType === 1 ? item.title : (item.title + index++),
}));
},
specialCategoryActive: {
get() {
return this.specialCategory.active || this.specialCategory.list?.[0]?.id || "";
......@@ -408,7 +417,7 @@ export default {
if (data && data.length) {
this.specialCategory.list = data.map((item, index) => ({
...item,
title: "特殊品类",
title: item.groupType === 1 ? "全部品类" : "特殊品类",
}));
// 设置为第一个
if (this.specialCategory.active === undefined) {
......
......@@ -21,7 +21,8 @@
</div>
</template>
</glsx-combi-form>
<AddMerchant :add-mer-visible="dialog.appendTraffic.show"
<AddMerchant v-if="dialog.appendTraffic.show"
:add-mer-visible="dialog.appendTraffic.show"
@handleClose="handleAppendTraffic">
</AddMerchant>
......
......@@ -349,10 +349,17 @@ export default {
}
// 如果是下一步, 且处在编辑状态
if (nextStep) {
console.log("是下一步");
if (isEdit(currentComponents.mode)) {
console.log("当前处于编辑模式");
this.loading.step = true;
try {
await this.$confirm("即将跳转到新表单页, 是否保存当前表单?", "提示", {
confirmButtonText: "保存",
cancelButtonText: "不保存,直接跳转",
type: "warning",
});
} catch (e) {
throw e;
}
// 校验表单 + 保存 = handleSave()
await currentComponents?.handleSave({
changeMode: false,
......@@ -360,18 +367,15 @@ export default {
});
console.log("编辑模式下, 保存完成");
}
console.log("即将执行 handleCheckIntegrity");
// 校验各个组件的品类中 是否有 integrity === N的
await currentComponents.handleCheckIntegrity();
}
console.log("全部校验通过,往下执行");
this.loading.step = true;
// 提交步骤,后端会自动+1
await postChangeBaseStepApi({
businessCode: this.businessCode,
nextStep,
});
console.log("下一步接口发送完成");
} finally {
this.loading.step = false;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!