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