Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d3ba0ce38b | |||
| f5be5245d6 | |||
| baf54efb7b | |||
| 32065b9c54 | |||
| 799a87641e | |||
| 28baa69e8f | |||
| 4ed80268b4 | |||
| 30c59c2acb | |||
| 39560bde79 |
@@ -253,16 +253,18 @@ export const option = createCrudOption([
|
||||
label: '客商',
|
||||
prop: 'partyName',
|
||||
search: true,
|
||||
searchOrder: 11,
|
||||
searchPlaceholder: '请输入',
|
||||
searchOrder: 14,
|
||||
searchPlaceholder: '请输入甲/乙方名称',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '合同编号',
|
||||
prop: 'contractNo',
|
||||
search: true,
|
||||
searchOrder: 6,
|
||||
searchOrder: 8,
|
||||
searchPlaceholder: '请输入',
|
||||
order: 185,
|
||||
maxlength: 100,
|
||||
@@ -287,7 +289,7 @@ export const option = createCrudOption([
|
||||
label: '所属项目',
|
||||
prop: 'projectName',
|
||||
search: true,
|
||||
searchOrder: 8,
|
||||
searchOrder: 11,
|
||||
searchType: 'select',
|
||||
searchPlaceholder: '请选择',
|
||||
formslot: true,
|
||||
@@ -334,7 +336,7 @@ export const option = createCrudOption([
|
||||
prop: 'contractCategory',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 9,
|
||||
searchOrder: 12,
|
||||
searchPlaceholder: '请选择',
|
||||
order: 170,
|
||||
dicData: contractCategoryOptions,
|
||||
@@ -346,7 +348,7 @@ export const option = createCrudOption([
|
||||
prop: 'signType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 10,
|
||||
searchOrder: 13,
|
||||
searchPlaceholder: '请选择',
|
||||
span: 8,
|
||||
order: 190,
|
||||
@@ -359,7 +361,7 @@ export const option = createCrudOption([
|
||||
prop: 'effectiveType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
searchOrder: 6,
|
||||
searchPlaceholder: '请选择',
|
||||
dicData: effectiveTypeOptions,
|
||||
hide: true,
|
||||
@@ -630,7 +632,7 @@ export const option = createCrudOption([
|
||||
prop: 'hcsSyncStatus',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 6,
|
||||
searchOrder: 7,
|
||||
searchPlaceholder: '请选择',
|
||||
slot: true,
|
||||
dicData: hcsSyncStatusOptions,
|
||||
@@ -660,7 +662,7 @@ export const option = createCrudOption([
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchPlaceholder: '请选择',
|
||||
searchOrder: 7,
|
||||
searchOrder: 9,
|
||||
dicData: yesNoOptions,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
@@ -672,7 +674,7 @@ export const option = createCrudOption([
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchPlaceholder: '请选择',
|
||||
searchOrder: 8,
|
||||
searchOrder: 10,
|
||||
dicData: yesNoOptions,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
|
||||
@@ -124,7 +124,8 @@ const formatGoodsInfo = row => {
|
||||
const text = Object.entries(groups)
|
||||
.map(([unit, group]) => {
|
||||
const quantity = formatGoodsQuantity(group.quantity);
|
||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${unit ? ` ${unit}` : ''}`;
|
||||
const typeName = group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||
return `${typeName} | ${quantity}${unit ? ` ${unit}` : ''}`;
|
||||
})
|
||||
.join('; ');
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
:data="data"
|
||||
ref="crud"
|
||||
v-model="form"
|
||||
v-model:page="page"
|
||||
:permission="permissionList"
|
||||
:before-open="beforeOpen"
|
||||
@row-del="rowDel"
|
||||
@@ -729,7 +730,9 @@ export default {
|
||||
onLoad(page, params = {}) {
|
||||
this.loading = true;
|
||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
||||
this.data = res.data.data;
|
||||
const data = res.data.data || {};
|
||||
this.data = data.records || [];
|
||||
this.page.total = data.total || 0;
|
||||
this.loading = false;
|
||||
this.selectionClear();
|
||||
});
|
||||
|
||||
@@ -3949,9 +3949,9 @@ export default {
|
||||
return Object.values(groups)
|
||||
.map(group => {
|
||||
const quantity = this.formatDispatchQuantity(group.quantity);
|
||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
||||
group.unit ? ` ${group.unit}` : ''
|
||||
}`;
|
||||
const typeName =
|
||||
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||
})
|
||||
.join('; ');
|
||||
},
|
||||
@@ -7549,12 +7549,13 @@ export default {
|
||||
}, {});
|
||||
|
||||
const cargoInfo = Object.values(groups)
|
||||
.map(
|
||||
group =>
|
||||
`${group.cargoType}等${group.count}种货物 | ${this.formatDispatchQuantity(
|
||||
group.quantity
|
||||
)}${group.unit ? ` ${group.unit}` : ''}`
|
||||
)
|
||||
.map(group => {
|
||||
const typeName =
|
||||
group.count > 1 ? `${group.cargoType}等${group.count}种货物` : group.cargoType;
|
||||
return `${typeName} | ${this.formatDispatchQuantity(group.quantity)}${
|
||||
group.unit ? ` ${group.unit}` : ''
|
||||
}`;
|
||||
})
|
||||
.join('; ');
|
||||
return cargoInfo || plan.goodsInfo || '';
|
||||
},
|
||||
|
||||
@@ -5018,9 +5018,9 @@ export default {
|
||||
return Object.values(groups)
|
||||
.map(group => {
|
||||
const quantity = this.formatQuantity(group.quantity);
|
||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
||||
group.unit ? ` ${group.unit}` : ''
|
||||
}`;
|
||||
const typeName =
|
||||
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||
})
|
||||
.join('; ');
|
||||
},
|
||||
|
||||
@@ -2545,9 +2545,9 @@ export default {
|
||||
Object.values(groups)
|
||||
.map(group => {
|
||||
const quantity = this.formatGoodsQuantity(group.quantity);
|
||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
||||
group.unit ? ` ${group.unit}` : ''
|
||||
}`;
|
||||
const typeName =
|
||||
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||
})
|
||||
.join('; ') || '-'
|
||||
);
|
||||
|
||||
@@ -489,6 +489,12 @@ const NODE_TEMPLATES = [
|
||||
},
|
||||
];
|
||||
|
||||
// 过程配置必须覆盖装货端与卸货端各一个节点;货量下限只看装货端——
|
||||
// 到场没有货量开关,不能拿它顶替货量采集
|
||||
const PICKUP_NODE_KEYS = ['arrive_scene', 'load', 'dispatch'];
|
||||
const DELIVERY_NODE_KEYS = ['unload', 'arrival', 'sign', 'return'];
|
||||
const CARGO_NODE_KEYS = ['load', 'dispatch'];
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -916,8 +922,24 @@ export default {
|
||||
this.$message.warning('备注不能超过500个字符');
|
||||
return false;
|
||||
}
|
||||
if (!this.enabledNodes.length) {
|
||||
this.$message.warning('请至少选择一个过程节点');
|
||||
const isEnabledNode = key => this.nodeRows.some(item => item.key === key && item.enabled);
|
||||
if (!PICKUP_NODE_KEYS.some(isEnabledNode)) {
|
||||
this.$message.warning('发货、装货、到场至少选择一个');
|
||||
return false;
|
||||
}
|
||||
if (!DELIVERY_NODE_KEYS.some(isEnabledNode)) {
|
||||
this.$message.warning('卸货、到货、签收、回单至少选择一个');
|
||||
return false;
|
||||
}
|
||||
// 装货端没有节点采集货量时,整条配置在小程序侧等于不采集货量
|
||||
const collectsCargo = CARGO_NODE_KEYS.some(key =>
|
||||
this.nodeRows.some(
|
||||
item =>
|
||||
item.key === key && item.enabled && item.uploadCargo && (item.cargoTypes || []).length
|
||||
)
|
||||
);
|
||||
if (!collectsCargo) {
|
||||
this.$message.warning('发货或装货至少勾选一个货量类型');
|
||||
return false;
|
||||
}
|
||||
const transit = this.nodeRows.find(item => item.key === 'transit');
|
||||
|
||||
@@ -1067,7 +1067,8 @@ import { formatContractOptionLabel } from '@/utils/contract';
|
||||
import { isTierUnitPrice, isUnitPriceAdjustable } from '@/utils/settlement-adjust-rule';
|
||||
import { downloadXls } from '@/utils/util';
|
||||
import { createSettlementTransfer } from '@/utils/settlement-transfer';
|
||||
import { settlementListPath } from '@/utils/settlement-menu';
|
||||
import { settlementBillLabel, settlementListPath } from '@/utils/settlement-menu';
|
||||
import { getList as getFormalSettlementList } from '@/api/settlement/formalSettlement';
|
||||
import {
|
||||
contractApprovalStatusOptions,
|
||||
contractCategoryOptions,
|
||||
@@ -1921,8 +1922,9 @@ export default {
|
||||
this.openSettlementDetail('/settlement/pre-settlement', row.preSettlementNo);
|
||||
return;
|
||||
}
|
||||
if (this.settlementType === 'payable' && column.prop === 'formalSettlementNo') {
|
||||
this.openSettlementDetail('/settlement/payment-settlement', row.formalSettlementNo);
|
||||
// 正式结算单号:跳转付款/收款结算单表单页并打开详情(与开票申请等入口一致)
|
||||
if (column.prop === 'formalSettlementNo') {
|
||||
this.openFormalSettlementDetail(row.formalSettlementNo);
|
||||
return;
|
||||
}
|
||||
this.openDetailDialog(row);
|
||||
@@ -1934,6 +1936,42 @@ export default {
|
||||
}
|
||||
this.$router.push({ path, query: { detailNo } });
|
||||
},
|
||||
async openFormalSettlementDetail(formalSettlementNo) {
|
||||
const normalizedNo = String(formalSettlementNo || '')
|
||||
.split(/[、,,]/)
|
||||
.map(item => item.trim())
|
||||
.find(Boolean);
|
||||
if (!normalizedNo) {
|
||||
this.$message.info('当前记录未关联结算单详情');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const data = this.unwrapPage(
|
||||
await getFormalSettlementList(1, 10, { formalSettlementNo: normalizedNo })
|
||||
);
|
||||
const row = (data.records || []).find(
|
||||
item => String(item.formalSettlementNo || '').trim() === normalizedNo
|
||||
);
|
||||
if (!row?.id) {
|
||||
this.$message.warning('未找到对应的正式结算单');
|
||||
return;
|
||||
}
|
||||
const settlementType = row.settlementType || this.settlementType || 'payable';
|
||||
const listPath = settlementListPath(settlementType);
|
||||
await this.$router.push({
|
||||
path: `${listPath}/form`,
|
||||
query: {
|
||||
mode: 'view',
|
||||
id: row.id,
|
||||
settlementType,
|
||||
listPath,
|
||||
name: `查看${settlementBillLabel(settlementType)}`,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
this.$message.error('正式结算单详情加载失败');
|
||||
}
|
||||
},
|
||||
async openRouteDetail(detailId = this.$route.query.detailId) {
|
||||
// 结算明细点「单据号」会带 detailId 跳到本页;只有当前停在应收/应付明细页时才自动展开详情
|
||||
const routePath =
|
||||
|
||||
@@ -66,17 +66,21 @@
|
||||
/>
|
||||
</template>
|
||||
<template #dataScopeDeptIds-form>
|
||||
<el-tree
|
||||
<!-- 与用户管理「数据管理权限」一致:组织多选级联,数据源同左侧组织树 -->
|
||||
<el-cascader
|
||||
v-if="Number(form.dataScopeRange) === 3"
|
||||
ref="dataScopeTree"
|
||||
:data="permissionDeptTree"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
:default-checked-keys="form.dataScopeDeptIds || []"
|
||||
:props="{ label: 'title', children: 'children' }"
|
||||
@check="handleDataScopeCheck"
|
||||
v-model="dataScopeCascaderValue"
|
||||
:options="permissionDeptTree"
|
||||
:props="deptCascaderProps"
|
||||
:disabled="isViewMode"
|
||||
clearable
|
||||
filterable
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
placeholder="请选择数据权限组织(可多选)"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<span v-else class="form-tip">选择「自定义」后可勾选数据权限组织</span>
|
||||
<span v-else class="form-tip">选择「自定义」后可选择数据权限组织</span>
|
||||
</template>
|
||||
<template #menu="{ row, index }">
|
||||
<el-link
|
||||
@@ -193,6 +197,26 @@ export default {
|
||||
: [];
|
||||
},
|
||||
},
|
||||
// 自定义数据权限组织:与用户管理数据管理权限相同的多选级联
|
||||
dataScopeCascaderValue: {
|
||||
get() {
|
||||
const ids = Array.isArray(this.form.dataScopeDeptIds)
|
||||
? this.form.dataScopeDeptIds
|
||||
: this.form.dataScopeDeptIds
|
||||
? String(this.form.dataScopeDeptIds).split(',').filter(Boolean)
|
||||
: [];
|
||||
return ids
|
||||
.filter(item => item !== undefined && item !== null && item !== '')
|
||||
.map(item => (typeof item === 'number' ? item : String(item)));
|
||||
},
|
||||
set(value) {
|
||||
this.form.dataScopeDeptIds = Array.isArray(value)
|
||||
? value.filter(item => item !== undefined && item !== null && item !== '')
|
||||
: value
|
||||
? [value]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.sensitiveManager = sensitive.create({
|
||||
@@ -228,12 +252,6 @@ export default {
|
||||
this.permissionDeptTree = res.data.data || [];
|
||||
});
|
||||
},
|
||||
handleDataScopeCheck(_, checked) {
|
||||
if (this.isViewMode) {
|
||||
return;
|
||||
}
|
||||
this.form.dataScopeDeptIds = checked.checkedKeys || [];
|
||||
},
|
||||
normalizeSubmitRow(row = {}, isUpdate = false) {
|
||||
let payload = { ...row };
|
||||
// 编辑时剔除未改动的脱敏字段,避免把 138****8000 写回库
|
||||
@@ -278,17 +296,19 @@ export default {
|
||||
detail.identities = detail.identities.split(',').filter(Boolean);
|
||||
}
|
||||
const deptIds = func.split(detail.deptId || '');
|
||||
const dataScopeDeptIds = Array.isArray(detail.dataScopeDeptIds)
|
||||
? detail.dataScopeDeptIds.map(item => String(item))
|
||||
: detail.dataScopeDeptIds
|
||||
? String(detail.dataScopeDeptIds).split(',').filter(Boolean)
|
||||
: [];
|
||||
this.form = {
|
||||
...detail,
|
||||
deptId: Array.isArray(deptIds) ? deptIds : [],
|
||||
dataScopeRange: detail.dataScopeRange || 1,
|
||||
dataLevelRange: detail.dataLevelRange || 1,
|
||||
dataScopeDeptIds: detail.dataScopeDeptIds || [],
|
||||
dataScopeDeptIds,
|
||||
};
|
||||
this.sensitiveManager?.saveInitialData(this.form);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dataScopeTree?.setCheckedKeys?.(this.form.dataScopeDeptIds || []);
|
||||
});
|
||||
done();
|
||||
});
|
||||
return;
|
||||
|
||||
@@ -1409,9 +1409,10 @@
|
||||
<el-form-item label="自评得分" :required="isOfflineScore">
|
||||
<el-input
|
||||
v-if="isOfflineScore"
|
||||
v-model="currentScore.selfScore"
|
||||
:model-value="formatScoreValue(currentScore.selfScore)"
|
||||
maxlength="10"
|
||||
:disabled="readonly"
|
||||
placeholder="请输入自评得分"
|
||||
@input="handleOfflineSelfScoreInput"
|
||||
@blur="recalculateOfflineScore"
|
||||
>
|
||||
@@ -2489,8 +2490,14 @@ export default {
|
||||
];
|
||||
const rows = categoryMap.map((category, index) => {
|
||||
const details = this.getScoreCategoryDetails(category.categoryCode);
|
||||
let selfScore = details.reduce((sum, item) => sum + Number(item.selfScore || 0), 0);
|
||||
let reviewScore = details.reduce((sum, item) => sum + Number(item.reviewScore || 0), 0);
|
||||
const sumCategoryScore = prop =>
|
||||
details.reduce((sum, item) => {
|
||||
if (this.isBlankScore(item[prop])) return sum;
|
||||
const value = Number(item[prop]);
|
||||
return sum + (Number.isFinite(value) ? value : 0);
|
||||
}, 0);
|
||||
let selfScore = sumCategoryScore('selfScore');
|
||||
let reviewScore = sumCategoryScore('reviewScore');
|
||||
// 暂定:加分/减分合计最高按 15 分计(分类汇总展示封顶后值)
|
||||
if (category.categoryCode === 'plus') {
|
||||
selfScore = Math.min(selfScore, HARDCODED_MAX_PLUS_SCORE);
|
||||
@@ -4552,6 +4559,9 @@ export default {
|
||||
quantificationId: score.quantificationId ? String(score.quantificationId) : '',
|
||||
evaluateMode: score.evaluateMode === 'offline' ? 'offline' : 'online',
|
||||
nextEvaluateDate: score.nextEvaluateDate || '',
|
||||
selfScore: this.normalizeScoreInputValue(score.selfScore),
|
||||
reviewScore: this.normalizeScoreInputValue(score.reviewScore),
|
||||
finalScore: this.normalizeScoreInputValue(score.finalScore),
|
||||
applyCreditLimit: this.normalizeOptionalAmount(
|
||||
score.applyCreditLimit === undefined
|
||||
? this.archiveForm.applyCreditLimit
|
||||
@@ -4565,6 +4575,8 @@ export default {
|
||||
details: (score.details || []).map(detail => ({
|
||||
...detail,
|
||||
scoreInput: this.normalizeScoreInputValue(detail.scoreInput),
|
||||
selfScore: this.normalizeScoreInputValue(detail.selfScore),
|
||||
reviewScore: this.normalizeScoreInputValue(detail.reviewScore),
|
||||
})),
|
||||
};
|
||||
},
|
||||
@@ -5345,7 +5357,9 @@ export default {
|
||||
return this.getScoreDetailCategoryCode(detail) === 'basic';
|
||||
},
|
||||
getSignedScore(detail, prop) {
|
||||
const score = Number(detail[prop] || 0);
|
||||
if (this.isBlankScore(detail[prop])) return '';
|
||||
const score = Number(detail[prop]);
|
||||
if (!Number.isFinite(score)) return '';
|
||||
return this.isMinusScoreDetail(detail) && score > 0 ? -score : score;
|
||||
},
|
||||
getScoreItemFullScore(detail = {}) {
|
||||
@@ -5419,7 +5433,12 @@ export default {
|
||||
const basicDetails = this.getScoreCategoryDetailsByList(details, 'basic');
|
||||
const plusDetails = this.getScoreCategoryDetailsByList(details, 'plus');
|
||||
const minusDetails = this.getScoreCategoryDetailsByList(details, 'minus');
|
||||
const sumScore = (list, prop) => list.reduce((sum, item) => sum + Number(item[prop] || 0), 0);
|
||||
const sumScore = (list, prop) =>
|
||||
list.reduce((sum, item) => {
|
||||
if (this.isBlankScore(item[prop])) return sum;
|
||||
const value = Number(item[prop]);
|
||||
return sum + (Number.isFinite(value) ? value : 0);
|
||||
}, 0);
|
||||
const rawPlusSelf = sumScore(plusDetails, 'selfScore');
|
||||
const rawPlusReview = sumScore(plusDetails, 'reviewScore');
|
||||
const rawMinusSelf = sumScore(minusDetails, 'selfScore');
|
||||
@@ -5434,33 +5453,51 @@ export default {
|
||||
const hasReviewScore = details.some(
|
||||
item => !this.isBlankScore(item.reviewScore)
|
||||
);
|
||||
// 线下模式允许手工改自评得分:有手工值时优先采用,否则回退明细合计
|
||||
// 线下模式允许手工改自评得分:有手工值时优先采用,否则回退明细合计;-1 视为未填
|
||||
const isOffline = String(score.evaluateMode || '') === 'offline';
|
||||
const hasManualSelfScore = isOffline && !this.isBlankScore(score.selfScore);
|
||||
const hasFilledDetail = details.some(item => {
|
||||
if (this.isScoreTypeDetail(item)) {
|
||||
const input = String(item.scoreInput ?? '').trim();
|
||||
return input !== '' && input !== '-' && input !== '.';
|
||||
}
|
||||
return !this.isBlankScore(item.selectedOption);
|
||||
});
|
||||
const manualSelfScore = Number(score.selfScore);
|
||||
const selfScore =
|
||||
isOffline && Number.isFinite(manualSelfScore) && String(score.selfScore ?? '').trim() !== ''
|
||||
? manualSelfScore
|
||||
: computedSelfScore;
|
||||
hasManualSelfScore && Number.isFinite(manualSelfScore) ? manualSelfScore : computedSelfScore;
|
||||
const finalScore = hasReviewScore ? reviewScore : selfScore;
|
||||
const fullMark = this.getScoreFullMark(details);
|
||||
const scoreRate =
|
||||
fullMark > 0 ? Math.max(0, Math.min(100, (finalScore / fullMark) * 100)) : 0;
|
||||
const standard = this.matchCreditStandard(score, scoreRate);
|
||||
const hasStandards = (score.standards || []).some(item => item && item.creditLevel);
|
||||
score.selfScore = Number(Number(selfScore).toFixed(2));
|
||||
// 线下未手工填写且明细未实际填报时保留空,避免默认写出 -1/0
|
||||
const keepOfflineScoreBlank = isOffline && !hasManualSelfScore && !hasFilledDetail;
|
||||
score.selfScore = keepOfflineScoreBlank ? '' : Number(Number(selfScore).toFixed(2));
|
||||
score.reviewScore = Number(reviewScore.toFixed(2));
|
||||
score.finalScore = Number(Number(finalScore).toFixed(2));
|
||||
score.scoreRate = Number(scoreRate.toFixed(2));
|
||||
score.finalScore =
|
||||
keepOfflineScoreBlank && !hasReviewScore ? '' : Number(Number(finalScore).toFixed(2));
|
||||
score.scoreRate = keepOfflineScoreBlank && !hasReviewScore ? '' : Number(scoreRate.toFixed(2));
|
||||
if (hasStandards) {
|
||||
score.creditLevel = standard?.creditLevel || '';
|
||||
score.maxCreditLimit = standard
|
||||
score.creditLevel = keepOfflineScoreBlank && !hasReviewScore ? '' : standard?.creditLevel || '';
|
||||
score.maxCreditLimit =
|
||||
keepOfflineScoreBlank && !hasReviewScore
|
||||
? ''
|
||||
: standard
|
||||
? this.calculateCreditLimitByStandard(standard, scoreRate)
|
||||
: '';
|
||||
}
|
||||
return score;
|
||||
},
|
||||
isBlankScore(value) {
|
||||
return value === undefined || value === null || String(value).trim() === '';
|
||||
return (
|
||||
value === undefined ||
|
||||
value === null ||
|
||||
value === -1 ||
|
||||
value === '-1' ||
|
||||
String(value).trim() === ''
|
||||
);
|
||||
},
|
||||
hasIncompleteBasicScoreDetail(details = []) {
|
||||
return this.getScoreCategoryDetailsByList(details, 'basic').some(item => {
|
||||
@@ -5968,6 +6005,27 @@ export default {
|
||||
this.currentScore.evaluateMode = mode === 'offline' ? 'offline' : 'online';
|
||||
if (this.isOfflineScore) {
|
||||
this.expandedScoreCategoryKeys = [];
|
||||
// 切到线下且明细尚未实际填报时清空自评,避免沿用线上合计或 -1 哨兵值
|
||||
const hasFilledDetail = (this.currentScore.details || []).some(item => {
|
||||
if (this.isScoreTypeDetail(item)) {
|
||||
const input = String(item.scoreInput ?? '').trim();
|
||||
return input !== '' && input !== '-' && input !== '.';
|
||||
}
|
||||
return !this.isBlankScore(item.selectedOption);
|
||||
});
|
||||
if (!hasFilledDetail || this.isBlankScore(this.currentScore.selfScore)) {
|
||||
this.currentScore.selfScore = '';
|
||||
}
|
||||
if (!hasFilledDetail || this.isBlankScore(this.currentScore.finalScore)) {
|
||||
this.currentScore.finalScore = '';
|
||||
}
|
||||
if (!hasFilledDetail) {
|
||||
this.currentScore.scoreRate = '';
|
||||
this.currentScore.creditLevel = '';
|
||||
this.currentScore.maxCreditLimit = '';
|
||||
}
|
||||
} else {
|
||||
this.calculateScore(this.currentScore);
|
||||
}
|
||||
},
|
||||
handleOfflineSelfScoreInput(value) {
|
||||
@@ -5981,6 +6039,19 @@ export default {
|
||||
},
|
||||
recalculateOfflineScore() {
|
||||
if (!this.isOfflineScore) return;
|
||||
if (this.isBlankScore(this.currentScore.selfScore)) {
|
||||
this.currentScore.selfScore = '';
|
||||
const hasReviewScore = (this.currentScore.details || []).some(
|
||||
item => !this.isBlankScore(item.reviewScore)
|
||||
);
|
||||
if (!hasReviewScore) {
|
||||
this.currentScore.finalScore = '';
|
||||
}
|
||||
this.currentScore.scoreRate = '';
|
||||
this.currentScore.creditLevel = '';
|
||||
this.currentScore.maxCreditLimit = '';
|
||||
return;
|
||||
}
|
||||
const selfScore = Number(this.currentScore.selfScore);
|
||||
if (!Number.isFinite(selfScore)) return;
|
||||
this.currentScore.selfScore = Number(selfScore.toFixed(2));
|
||||
|
||||
Reference in New Issue
Block a user