Commit b42aeae1 by chenwq

Merge branch 'SAAS+V5.8.4' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into feature/584/cwq
2 parents c4bcb30f 6b9658b2
......@@ -6,7 +6,15 @@ function formatDate(val) {
}
function formatDelayDeadline(val) {
return val ? Util.dateFormate(val, "YYYY-MM-DD") : "-"
if (!val) {
return "-";
}
const str = String(val).trim();
const dateMatch = str.match(/^(\d{4}-\d{2}-\d{2})/);
if (dateMatch) {
return dateMatch[1];
}
return Util.dateFormate(val, "YYYY-MM-DD");
}
export const APPROVAL_STATUS = {
......
......@@ -4,7 +4,7 @@
<div class="first-box flex">
<template v-for="(item, index) in fourFormObj">
<div class="item first-form-item" :key="index">
<div class="label">{{ item.name }}:</div>
<div :class="['label',{required:!isViewMode}]">{{ item.name }}:</div>
<template v-if="isViewMode">{{ getSelectText(item, componentData.pointsConfig) }}</template>
<el-select :size="size" v-model="componentData.pointsConfig[item.key]" class="step-select"
:disabled="disabled" v-else>
......@@ -30,7 +30,7 @@
<div class="form-box">
<template v-for="(item, index) in fourFormTwoObj">
<el-form-item :label="item.name + ':'" :key="index" :prop="item.key">
<el-form-item :label="item.name + ':'" :key="index" :prop="isViewMode ? '' : (item.inputKey || item.key)">
<template v-if="item.type == 'addHtml'">
{{ formateData(componentData.productCategoryRules[productCategoryIndex][item.key]) }}
</template>
......@@ -254,13 +254,13 @@ export default {
getExpenseCategoryCalculateTypeOptions(targetType) {
let options = [];
if (targetType === 1) {
options = this.options.expenseCategoryOther;
options = deepClone(this.options.expenseCategoryOther);
}
if (targetType === 2) {
options = this.options.expenseCategoryServer;
options = deepClone(this.options.expenseCategoryServer);
}
if (targetType === 3) {
options = this.options.expenseCategoryDefault;
options = deepClone(this.options.expenseCategoryDefault);
}
options.forEach((item) => {
item.expenseCategoryCalculateType = String(item.expenseCategoryCalculateType);
......@@ -362,6 +362,9 @@ export default {
color: #333333;
font-size: 14px;
}
.required{
&::before {
content: '*';
color: #F56C6C;
......
......@@ -2,28 +2,29 @@
<div>
<SplitPayment :disabled="disabled || isViewMode" :list="componentData.divisionRuleAutos" />
<div class="item">
<div class="label">流量方分账方:</div>
<template v-if="shelfType == 1">
<template v-if="isViewMode">
{{ componentData.autoDivideConfig.realityShopMerchantName || '-' }}
<div :class="['label',{required:!isViewMode}]">流量方分账方:</div>
<template v-if="componentData.autoDivideConfig">
<template v-if="shelfType == 1">
<template v-if="isViewMode">
{{ componentData.autoDivideConfig.realityShopMerchantName || '-' }}
</template>
<el-select v-else :size="size" v-model="componentData.autoDivideConfig.realityShopMerchantId"
class="step-select" @change="handleRealityShopMerchantIdChange">
<el-option v-for="(item, ind) in options.merchantLevel" :key="item.merchantId" :label="item.showMerchantName"
:value="item.merchantId">
</el-option>
</el-select>
</template>
<el-select v-else :size="size" v-model="componentData.autoDivideConfig.realityShopMerchantId"
class="step-select" @change="handleRealityShopMerchantIdChange">
<el-option v-for="(item, ind) in options.merchantLevel" :key="item.merchantId" :label="item.showMerchantName"
:value="item.merchantId">
</el-option>
</el-select>
</template>
<template v-else>
<template v-if="isViewMode">
{{ getRealityShopLevelName(componentData.autoDivideConfig.realityShopLevel) }}
<template v-else>
<template v-if="isViewMode">
{{ getRealityShopLevelName(componentData) }}
</template>
<el-select v-else :size="size" v-model="componentData.autoDivideConfig.realityShopLevel" class="step-select">
<el-option v-for="item in options.realityShopLevelOptions" :key="item.realityShopLevel"
:label="item.realityShopLevelName" :value="item.realityShopLevel">
</el-option>
</el-select>
</template>
<el-select v-else :size="size" v-model="componentData.autoDivideConfig.realityShopLevel" class="step-select">
<el-option v-for="item in options.realityShopLevelOptions" :key="item.realityShopLevel"
:label="item.realityShopLevelName" :value="item.realityShopLevel">
</el-option>
</el-select>
</template>
</div>
<div class="step-title flex">
......@@ -43,7 +44,7 @@
<div class="form-box">
<template v-for="(item, index) in threeFormObj">
<el-form-item :label="item.name + ':'" :key="index" :prop="item.inputKey || item.key">
<el-form-item :label="item.name + ':'" :key="index" :prop="isViewMode ? '' : (item.inputKey || item.key)">
<template v-if="item.type == 'addHtml'">
<template v-if="item.htmlName == 'RemoteSelect'">
<div class="remote-select">
......@@ -116,6 +117,7 @@ import {
otherSelectOptions,
severSelectOptions,
} from "@/common/constant/merchant";
import { deepClone } from "@/common/util";
import VenusNumberInput from "@/components/venusNumberInput/index.vue";
import { realityShopLevelOptions } from "@/views/goods/shelfProduct/constant/index";
import { getSingleRealityShopMerchantOptions, getProfitSharingBaseDetail } from "@/views/goods/shelfProduct/components/profitSharingConfig/hooks";
......@@ -320,13 +322,13 @@ export default {
getExpenseCategoryCalculateTypeOptions(targetType) {
let options = [];
if (targetType === 1) {
options = this.options.expenseCategoryOther;
options = deepClone(this.options.expenseCategoryOther);
}
if (targetType === 2) {
options = this.options.expenseCategoryServer;
options = deepClone(this.options.expenseCategoryServer);
}
if (targetType === 3) {
options = this.options.expenseCategoryDefault;
options = deepClone(this.options.expenseCategoryDefault);
}
options.forEach((item) => {
item.expenseCategoryCalculateType = String(item.expenseCategoryCalculateType);
......@@ -420,7 +422,9 @@ export default {
this.$set(this.componentData, 'autoDivideConfig', autoDivideConfig);
},
getRealityShopLevelName(realityShopLevel) {
getRealityShopLevelName(i) {
let realityShopLevel = i?.autoDivideConfig?.realityShopLevel
if(realityShopLevel == null || realityShopLevel == undefined || realityShopLevel == '') return '-'
return this.options.realityShopLevelOptions.find(item => item.realityShopLevel == realityShopLevel)?.realityShopLevelName || '-'
}
}
......@@ -464,7 +468,10 @@ export default {
color: #333333;
&::before {
}
.required {
&::before {
content: '*';
color: #F56C6C;
margin-right: 4px;
......
......@@ -123,7 +123,6 @@ export default {
guaranteeConfigs.map(item => {
if(item.guaranteeIndex) includesConditionList.push(item.guaranteeIndex)
})
console.log(includesConditionList)
return includesConditionList
},
},
......
......@@ -38,7 +38,7 @@
</div>
<div class="step-content">
<div :class="['step-title', { top54: trafficPartyConfigs.length > 1 }]">对账配置</div>
<StepFourForm :isViewMode="isViewMode" :currentItem="currentReconciliationSceneConfigs" />
<StepFourForm :isViewMode="isViewMode" :currentItem="currentReconciliationSceneConfigs" :baseSceneCode="baseSceneCode" />
</div>
<div class="step-content">
<div class="step-title ">操作记录</div>
......@@ -212,9 +212,9 @@ export default {
baseSceneName: i.baseSceneName
}
i.trafficPartyDetails.map(item => {
let label = `流量方:${item.trafficPartyName}`,
let label = i.trafficPartyDetails.length > 1 ? `流量方:【${item.trafficPartyName}】` : '',
judgment = shelfType == 1 ? i.baseSceneCode != baseSceneCode : item.trafficPartyId != trafficPartyId
if (shelfType == 1) label = `场景:${i.baseSceneName}`
if (shelfType == 1 && trafficPartyConfigs.length > 1) label = `场景:【${i.baseSceneName}】`
if (judgment) {
rulesKeys.map(key => {
if (item[key] === undefined || item[key] === null) {
......
......@@ -22,7 +22,8 @@
<div class="detail-box view" v-loading="true"></div>
</template>
<div class="fixed-btn-box flex">
<template v-if="pageComplete">
<template v-if="buttonComplete">
<template v-if="pageComplete">
<el-button v-if="pageType == 'audit' && step == 4" type="primary" @click="rejectDialogVisible = true"
plain>驳回</el-button>
<el-button v-if="!['audit', 'view'].includes(pageType) && [3,4].includes(step) " type="primary" @click="prevStep"
......@@ -32,6 +33,7 @@
</template>
<el-button v-if="!buttonLoading" @click="$router.go(-1)" plain type="info">{{ pageType == 'view' ? '返回' : '取消'
}}</el-button>
</template>
</div>
<el-dialog :close-on-click-modal="false" :show-close="false" title="提示" :visible.sync="dialogVisible" width="40%"
......@@ -166,7 +168,8 @@ export default {
buttonLoading: false,
rejectDialogVisible: false,
rejectReason: '',
basicinformationData: {}
basicinformationData: {},
buttonComplete:false
}
},
watch: {
......@@ -221,6 +224,7 @@ export default {
step = isPrevStep ? STEP - 1 : (updStep ? updStep + 1 : 2)
this.basicinformationData = data
let basicinformationFormList = JSON.parse(basicApproveInfo)
this.buttonComplete = false
if (pageType != 'reapply') {
if (pageType == 'view') {
this.step = 2
......@@ -280,6 +284,9 @@ export default {
this.stepOneRef.init(shelfType, infoForm)
})
}
setTimeout(() => {
this.buttonComplete = true
}, 500)
},
......@@ -302,6 +309,7 @@ export default {
} else this.pageComplete = true
} else throw '获取模板信息失败'
this.buttonComplete = true
} catch (error) {
this.$message.error(error)
}
......@@ -396,8 +404,7 @@ export default {
if (params) this.$message.error(params)
}
})
}
else if (step == 3) {
} else if (step == 3) {
this.stepThreeRef.validate(async (valid, params) => {
if (valid) {
params.businessCode = businessCode
......@@ -480,13 +487,13 @@ export default {
}
.layout {
height: calc(100vh - 113px);
height: calc(100vh - 124px);
// padding: 0 24px;
box-sizing: border-box;
.detail-box {
position: relative;
height: calc(100% - 190px);
height: calc(100% - 178px);
.detail {
height: 100%;
......
......@@ -2765,7 +2765,8 @@ export default {
}
::v-deep {
.el-select__tags {
.el-select__tags,
.el-cascader__tags {
white-space: nowrap;
overflow: hidden;
flex-wrap: nowrap;
......@@ -2775,10 +2776,19 @@ export default {
align-items: center;
}
}
.el-cascader__tags {
.el-tag span {
display: inline-block;
max-width: 240px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.el-select__tags-text {
display: inline-block;
max-width: 260px;
max-width: 240px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
......
......@@ -61,13 +61,11 @@
]">
<el-cascader v-model="cascaderGoodsTypes"
placeholder="请选择品类"
style="width: 320px"
clearable
style="width: 370px"
collapse-tags
filterable
:options="computedGoodsTypeTreeList"
:props="cascaderProps"
:show-all-levels="false"
@change="onCascaderChange" />
</el-form-item>
<el-form-item v-show="classificationObj.categoryType == 2"
......@@ -307,18 +305,19 @@ export default {
}
});
// 1. 处理当前Tab已选路径(同一Tab内的禁用规则)
currentPaths.forEach((path) => {
if (!path || !path.length) {
return;
}
// 禁用该路径的所有祖先(从第0个到倒数第2个)
for (let i = 0; i < path.length - 1; i++) {
shouldDisableValues.add(path[i]);
}
// 禁用该路径的所有后代
this.collectAllDescendantsByPath(tree, path, shouldDisableValues);
});
// ⚠️ 同Tab内的禁用规则已注释:不再禁用祖先和后代节点,允许在同一Tab内自由选择
// // 1. 处理当前Tab已选路径(同一Tab内的禁用规则)
// currentPaths.forEach((path) => {
// if (!path || !path.length) {
// return;
// }
// // 禁用该路径的所有祖先(从第0个到倒数第2个)
// for (let i = 0; i < path.length - 1; i++) {
// shouldDisableValues.add(path[i]);
// }
// // 禁用该路径的所有后代
// this.collectAllDescendantsByPath(tree, path, shouldDisableValues);
// });
// 2. 处理其他Tab已选路径(跨Tab禁用规则)
// 规则:只禁用节点本身(防止重复),父级、子级、兄弟级都可以选
......
......@@ -65,13 +65,11 @@
])">
<el-cascader v-model="cascaderGoodsTypes"
placeholder="请选择品类"
style="width: 320px"
clearable
style="width: 370px"
collapse-tags
filterable
:options="computedGoodsTypeTreeList"
:props="cascaderProps"
:show-all-levels="false"
@change="onCascaderChange" />
</el-form-item>
<el-form-item v-show="classificationObj.categoryType == 2"
......@@ -81,7 +79,7 @@
v-el-select-loadmore="interestsLoadmore"
placeholder="请选择商品"
popper-class="class123"
style="width: 320px"
style="width: 370px"
value-key="merchantGoodsCode"
collapse-tags
filterable
......@@ -1214,18 +1212,19 @@ export default {
}
});
// 1. 处理当前Tab已选路径(同一Tab内的禁用规则)
currentPaths.forEach((path) => {
if (!path || !path.length) {
return;
}
// 禁用该路径的所有祖先(从第0个到倒数第2个)
for (let i = 0; i < path.length - 1; i++) {
shouldDisableValues.add(path[i]);
}
// 禁用该路径的所有后代
this.collectAllDescendantsByPath(tree, path, shouldDisableValues);
});
// ⚠️ 同Tab内的禁用规则已注释:不再禁用祖先和后代节点,允许在同一Tab内自由选择
// // 1. 处理当前Tab已选路径(同一Tab内的禁用规则)
// currentPaths.forEach((path) => {
// if (!path || !path.length) {
// return;
// }
// // 禁用该路径的所有祖先(从第0个到倒数第2个)
// for (let i = 0; i < path.length - 1; i++) {
// shouldDisableValues.add(path[i]);
// }
// // 禁用该路径的所有后代
// this.collectAllDescendantsByPath(tree, path, shouldDisableValues);
// });
// 2. 处理其他Tab已选路径(跨Tab禁用规则)
// 规则:只禁用节点本身(防止重复),父级、子级、兄弟级都可以选
......@@ -2928,7 +2927,8 @@ export default {
}
::v-deep {
.el-select__tags {
.el-select__tags,
.el-cascader__tags {
white-space: nowrap;
overflow: hidden;
flex-wrap: nowrap;
......@@ -2938,10 +2938,19 @@ export default {
align-items: center;
}
}
.el-cascader__tags {
.el-tag span {
display: inline-block;
max-width: 240px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.el-select__tags-text {
display: inline-block;
max-width: 180px;
max-width: 240px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
......
......@@ -167,6 +167,10 @@ import {
getStableReconciliationRuleId,
mergeReconciliationRuleServerFields,
} from "./utils/reconciliationIncrementalRules";
import {
getReconciliationRuleIndexForTab,
hasPhantomFullCategoryRuleSlot,
} from "./utils/reconciliationRuleTabIndex";
import { applyGoodsTypeGroupRelationBranches } from "./utils/reconciliationRuleBranches";
import {
fillDjGoodsTypeGroupRelations,
......@@ -475,20 +479,11 @@ export default {
* 首条规则为特殊品类时 tab0「全部品类」仅占位,无对应规则行,返回 null(不可按 tab 下标写 rules[0])。
*/
reconciliationRuleIndexForTabIndex(tabIndex) {
const rules = this.goodsTypeGroupReconciliationRules;
if (!Array.isArray(rules) || !rules.length) {
return tabIndex;
}
if (rules[0]?.groupType == 1) {
return tabIndex;
}
if (rules[0]?.groupType == 2) {
if (tabIndex <= 0) {
return null;
}
return tabIndex - 1;
}
return tabIndex;
return getReconciliationRuleIndexForTab(
this.goodsTypeGroupReconciliationRules,
tabIndex,
this.getEffectivePhantomFullCategoryRuleRaw(),
);
},
/**
* live phantom 在 getEffectRule 末尾会清空;与基线比对、resolve、子组件 props 需回落 baseline.phantomFullCategoryRule。
......@@ -520,7 +515,10 @@ export default {
* tab0「全部品类」仅占位:首条接口规则为特殊品类时,tab0 无 goodsTypeGroupReconciliationRules 行。
*/
hasPhantomFullCategoryTab() {
return this.reconciliationRuleIndexForTabIndex(0) == null;
return hasPhantomFullCategoryRuleSlot(
this.goodsTypeGroupReconciliationRules,
this.getEffectivePhantomFullCategoryRuleRaw(),
);
},
/**
* 基线中与 Tab ti 对应的原始规则行(tab0 phantom 用 baseline.phantomFullCategoryRule,否则 rules[ruleIdx])。
......@@ -1400,52 +1398,41 @@ export default {
newActiveIndex -= 1;
}
const goodsTypeGroupRules = this.getAllReconciliationParams();
const upgradeArr = [];
const packageArr = [];
const prevTabsMeta = this.editableTabs.map(t => ({
classificationUserTouched: !!t.classificationUserTouched,
sessionAdded: !!t.sessionAdded,
}));
this.editableTabs = [];
goodsTypeGroupRules.splice(removeIdx, 1);
// this.$set(this.goodsTypeGroupReconciliationRules, goodsTypeGroupRules)
this.$nextTick(() => {
this.goodsTypeGroupReconciliationRules = goodsTypeGroupRules;
if (
ruleIdxRemoved != null
&& ruleIdxRemoved < this.goodsTypeGroupReconciliationRules.length
) {
this.goodsTypeGroupReconciliationRules.splice(ruleIdxRemoved, 1);
}
tabs.splice(removeIdx, 1);
tabs.forEach((tab, index) => {
this.$set(tab, "title", index ? "特殊品类" + index : "全部品类");
this.$set(tab, "name", (index + 1).toString());
});
const typeList = goodsTypeGroupRules;
const newLen = typeList.length;
newActiveIndex = Math.max(0, Math.min(newActiveIndex, newLen - 1));
this.editableTabsValue = (newActiveIndex + 1).toString();
newActiveIndex = Math.max(0, Math.min(newActiveIndex, tabs.length - 1));
this.editableTabsValue = tabs[newActiveIndex].name;
typeList.forEach((item, index) => {
const oldIdx = index < removeIdx ? index : index + 1;
const meta = prevTabsMeta[oldIdx];
const classificationUserTouched = !!(meta && meta.classificationUserTouched);
const sessionAdded = !!(meta && meta.sessionAdded);
this.editableTabs[index] = {
title: index ? "特殊品类" + index : "全部品类",
name: (index + 1).toString(),
classificationUserTouched,
sessionAdded,
};
applyGoodsTypeGroupRelationBranches(
item,
this.goodsTypeGroupReconciliationRules[index],
upgradeArr,
packageArr,
);
});
this.getSelectingList(upgradeArr);
this.getSelectingListPackage(packageArr);
this.rebuildCrossTabGoodsSelectionsFromRules();
this.bumpReconciliationInteractionEpoch();
// this.queryFeeCategoryByTypeFlow = deepClone(this.queryFeeCategoryByTypeFlow)
this.$message({
type: "success",
message: "删除成功!",
});
this.goodsTypeGroupReconciliationRules.forEach((item) => {
applyGoodsTypeGroupRelationBranches(
item,
item,
upgradeArr,
packageArr,
);
});
this.getSelectingList(upgradeArr);
this.getSelectingListPackage(packageArr);
this.rebuildCrossTabGoodsSelectionsFromRules();
this.bumpReconciliationInteractionEpoch();
await this.$nextTick();
this.$message({
type: "success",
message: "删除成功!",
});
return true;
},
deleteGoodsTypeItem(item) {
......
/**
* “全部品类”没有服务端规则行、但页面保留了草稿快照时,该 Tab 使用独立的 phantom 槽位。
* rules 为空时仍需保留此语义,否则删除最后一个特殊品类后会把全部品类草稿判成空槽位。
*/
export function hasPhantomFullCategoryRuleSlot(rules, phantomRule) {
const list = Array.isArray(rules) ? rules : [];
if (list[0]?.groupType == 1) {
return false;
}
if (list[0]?.groupType == 2) {
return true;
}
return !!(phantomRule && typeof phantomRule === "object");
}
/**
* 页面 Tab 下标转服务端规则数组下标。
* phantom 占用 Tab 0,但不占 rules 数组位置,因此特殊品类需向前偏移一位。
*/
export function getReconciliationRuleIndexForTab(
rules,
tabIndex,
phantomRule,
) {
if (!hasPhantomFullCategoryRuleSlot(rules, phantomRule)) {
return tabIndex;
}
if (tabIndex <= 0) {
return null;
}
return tabIndex - 1;
}
const {
getReconciliationRuleIndexForTab,
hasPhantomFullCategoryRuleSlot,
} = require("./reconciliationRuleTabIndex");
describe("对账规则 Tab 下标映射", () => {
const phantomRule = {
groupType: 1,
expenseCategoryRules: [ { expenseCategoryId: "flow" } ],
};
it("全部品类为占位草稿时,特殊品类从 rules[0] 开始映射", () => {
const rules = [
{ groupType: 2, groupDivisionRuleId: "special-1" },
{ groupType: 2, groupDivisionRuleId: "special-2" },
];
expect(hasPhantomFullCategoryRuleSlot(rules, phantomRule)).toBe(true);
expect(getReconciliationRuleIndexForTab(rules, 0, phantomRule)).toBeNull();
expect(getReconciliationRuleIndexForTab(rules, 1, phantomRule)).toBe(0);
expect(getReconciliationRuleIndexForTab(rules, 2, phantomRule)).toBe(1);
});
it("删除最后一个特殊品类后 rules 为空,仍保留全部品类占位草稿", () => {
const rules = [];
expect(hasPhantomFullCategoryRuleSlot(rules, phantomRule)).toBe(true);
expect(getReconciliationRuleIndexForTab(rules, 0, phantomRule)).toBeNull();
});
it("已有正式全部品类规则时,优先使用 rules[0]", () => {
const rules = [ { groupType: 1, groupDivisionRuleId: "full-1" } ];
expect(hasPhantomFullCategoryRuleSlot(rules, phantomRule)).toBe(false);
expect(getReconciliationRuleIndexForTab(rules, 0, phantomRule)).toBe(0);
});
it("规则和草稿都为空时,全部品类使用可写的 rules[0] 槽位", () => {
expect(hasPhantomFullCategoryRuleSlot([], null)).toBe(false);
expect(getReconciliationRuleIndexForTab([], 0, null)).toBe(0);
});
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!