e6e451b6 by lxs Committed by lihua

数据定价更新

1 parent 3703e25a
......@@ -222,7 +222,7 @@ const signatoryFormItems: any = ref([
placeholder: '请输入',
field: 'weight',
default: '',
inputType: 'factorNumber',
inputType: 'scoreNumber',
maxlength: 10,
clearable: true,
},
......@@ -314,7 +314,7 @@ const targetFormItems: any = ref([
placeholder: '请输入',
field: 'weight',
default: '',
inputType: 'factorNumber',
inputType: 'scoreNumber',
maxlength: 10,
clearable: true,
required: true,
......@@ -354,7 +354,7 @@ const targetFormItems: any = ref([
placeholder: '请输入',
field: 'defaultValue',
default: '',
inputType: 'factorNumber',
inputType: 'moneyNumber',
maxlength: 18,
clearable: true,
required: false
......@@ -548,35 +548,44 @@ const drawerInfo: any = ref({
});
const setTableField = (data) => {
tableData.value = [];
const dictionaryName = typeMap.value['dictionaryType'].find(item => item.value == dictionaryType.value)?.label || '';
const dictionaryJson = dictionaryName && dictionaryName == currTableData.value.dictionaryName ? (currTableData.value.dictionaryJson || []) : [];
// if (dictionaryType.value == '1') {
// const tData = JSON.parse(JSON.stringify(mergeTableData));
// tableData.value = [];
// const dictionaryName = typeMap.value['dictionaryType'].find(item => item.value == dictionaryType.value)?.label || '';
// const dictionaryJson = dictionaryName && dictionaryName == currTableData.value.dictionaryName ? (currTableData.value.dictionaryJson || []) : [];
// if (dictionaryJson.length) {
// tData.map((item, i) => {
// item.factor = dictionaryJson[i]?.value || '';
// dictionaryJson.map(item => {
// tableData.value.push({
// label: item.name,
// factor: item.value || '',
// })
// })
// }
// tableData.value = tData;
// getMergeRow();
// } else {
// data.map((item: any) => {
// tableData.value.push({
// label: item.label,
// factor: '',
// })
// })
// }
tableData.value = [];
const dictionaryName = typeMap.value['dictionaryType'].find(item => item.value == dictionaryType.value)?.label || '';
const dictionaryJson = dictionaryName && dictionaryName == currTableData.value.dictionaryName ? (currTableData.value.dictionaryJson || []) : [];
// 创建已有数据的映射表,以 label 为键
const existingDataMap = {};
if (dictionaryJson.length) {
dictionaryJson.map(item => {
tableData.value.push({
label: item.name,
factor: item.value || '',
})
})
} else {
data.map((item: any) => {
dictionaryJson.forEach(item => {
existingDataMap[item.name] = item.value || '';
});
}
// 遍历最新数据,如果有匹配的已有数据则使用其值
data.forEach((item: any) => {
tableData.value.push({
label: item.label,
factor: '',
})
})
}
// }
factor: existingDataMap[item.label] || '', // 使用已有值或空字符串
});
});
}
const getDictionaryRuleData = () => {
......@@ -833,6 +842,7 @@ const selectChange = async (val, row, info) => {
await setFormItems(tInfo, 'target');
if (row.field == 'targetType') {
targetFormItems.value[3].default = val == '1' ? 'N' : 'Y';
targetFormItems.value[4].default = val == '1' ? 'N' : 'Y';
}
}
}
......@@ -1266,30 +1276,6 @@ onMounted(() => {
<template v-if="showFactorTable">
<span class="required_mark" style="line-height: 21px;">字典值对应因子</span>
<div class="table_panel">
<!-- <el-table border :data="tableData" :span-method="tableSpanMethod" tooltip-effect="light" style="height: 100%;"
v-if="dictionaryType == '1'">
<el-table-column label="医院等级">
<el-table-column prop="level" label="级别" width="100" />
<el-table-column prop="grade" label="等次" width="100" />
</el-table-column>
<el-table-column prop="factor" label="因子" class-name="edit-col">
<template #default="scope">
<el-input v-model="scope.row.factor" placeholder="请输入"
@change="(val) => inputChange(val, scope, 'factor')"
@input="(val) => inputEventChange(val, scope, 'factor')" />
</template>
</el-table-column>
</el-table>
<el-table border :data="tableData" tooltip-effect="light" style="height: 100%;" v-else>
<el-table-column label="字典名称" prop="label" width="140" />
<el-table-column prop="factor" label="因子" class-name="edit-col">
<template #default="scope">
<el-input v-model="scope.row.factor" placeholder="请输入"
@change="(val) => inputChange(val, scope, 'factor')"
@input="(val) => inputEventChange(val, scope, 'factor')" />
</template>
</el-table-column>
</el-table> -->
<el-table border :data="tableData" tooltip-effect="light" style="height: 100%;">
<el-table-column label="字典名称" prop="label" width="140" />
<el-table-column prop="factor" label="因子" class-name="edit-col">
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!