|
|
@@ -12,8 +12,8 @@
|
|
|
|
|
|
<el-table :data="rows" v-loading="loading" border stripe highlight-current-row max-height="calc(100vh - 260px)">
|
|
|
<el-table-column prop="substituteCode" label="替代方案" min-width="160" show-overflow-tooltip />
|
|
|
- <el-table-column prop="substituteStrategy" label="替代策略" min-width="140" show-overflow-tooltip />
|
|
|
- <el-table-column prop="substituteMode" label="替代方式" min-width="140" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="substituteStrategy" label="替代策略" min-width="140" :formatter="formatSubstituteStrategy" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="substituteMode" label="替代方式" min-width="140" :formatter="formatSubstituteMode" show-overflow-tooltip />
|
|
|
</el-table>
|
|
|
|
|
|
<div class="pager">
|
|
|
@@ -39,6 +39,29 @@ import { s0SubstituteSchemesApi, type S0SubstituteSchemeRow } from '../api/s0Sal
|
|
|
const route = useRoute();
|
|
|
const pageTitle = computed(() => (route.meta?.title as string) || '选择替代方案');
|
|
|
|
|
|
+// 映射来自业务配置(瑞奇 DOP)
|
|
|
+const SUBSTITUTE_STRATEGY_LABELS: Record<string, string> = {
|
|
|
+ '0': '整批',
|
|
|
+ '1': '混用',
|
|
|
+ '2': '整批+混用',
|
|
|
+};
|
|
|
+const SUBSTITUTE_MODE_LABELS: Record<string, string> = {
|
|
|
+ '0': '替代',
|
|
|
+ '1': '取代',
|
|
|
+};
|
|
|
+
|
|
|
+function formatSubstituteStrategy(_row: S0SubstituteSchemeRow, _col: unknown, value: unknown): string {
|
|
|
+ if (value === null || value === undefined || value === '') return '';
|
|
|
+ const key = String(value);
|
|
|
+ return SUBSTITUTE_STRATEGY_LABELS[key] ?? key;
|
|
|
+}
|
|
|
+
|
|
|
+function formatSubstituteMode(_row: S0SubstituteSchemeRow, _col: unknown, value: unknown): string {
|
|
|
+ if (value === null || value === undefined || value === '') return '';
|
|
|
+ const key = String(value);
|
|
|
+ return SUBSTITUTE_MODE_LABELS[key] ?? key;
|
|
|
+}
|
|
|
+
|
|
|
const query = reactive({
|
|
|
substituteCode: '',
|
|
|
page: 1,
|