数据定价更新
Showing
2 changed files
with
39 additions
and
53 deletions
This diff is collapsed.
Click to expand it.
| ... | @@ -222,7 +222,7 @@ const signatoryFormItems: any = ref([ | ... | @@ -222,7 +222,7 @@ const signatoryFormItems: any = ref([ |
| 222 | placeholder: '请输入', | 222 | placeholder: '请输入', |
| 223 | field: 'weight', | 223 | field: 'weight', |
| 224 | default: '', | 224 | default: '', |
| 225 | inputType: 'factorNumber', | 225 | inputType: 'scoreNumber', |
| 226 | maxlength: 10, | 226 | maxlength: 10, |
| 227 | clearable: true, | 227 | clearable: true, |
| 228 | }, | 228 | }, |
| ... | @@ -314,7 +314,7 @@ const targetFormItems: any = ref([ | ... | @@ -314,7 +314,7 @@ const targetFormItems: any = ref([ |
| 314 | placeholder: '请输入', | 314 | placeholder: '请输入', |
| 315 | field: 'weight', | 315 | field: 'weight', |
| 316 | default: '', | 316 | default: '', |
| 317 | inputType: 'factorNumber', | 317 | inputType: 'scoreNumber', |
| 318 | maxlength: 10, | 318 | maxlength: 10, |
| 319 | clearable: true, | 319 | clearable: true, |
| 320 | required: true, | 320 | required: true, |
| ... | @@ -354,7 +354,7 @@ const targetFormItems: any = ref([ | ... | @@ -354,7 +354,7 @@ const targetFormItems: any = ref([ |
| 354 | placeholder: '请输入', | 354 | placeholder: '请输入', |
| 355 | field: 'defaultValue', | 355 | field: 'defaultValue', |
| 356 | default: '', | 356 | default: '', |
| 357 | inputType: 'factorNumber', | 357 | inputType: 'moneyNumber', |
| 358 | maxlength: 18, | 358 | maxlength: 18, |
| 359 | clearable: true, | 359 | clearable: true, |
| 360 | required: false | 360 | required: false |
| ... | @@ -548,35 +548,44 @@ const drawerInfo: any = ref({ | ... | @@ -548,35 +548,44 @@ const drawerInfo: any = ref({ |
| 548 | }); | 548 | }); |
| 549 | 549 | ||
| 550 | const setTableField = (data) => { | 550 | const setTableField = (data) => { |
| 551 | tableData.value = []; | 551 | // tableData.value = []; |
| 552 | const dictionaryName = typeMap.value['dictionaryType'].find(item => item.value == dictionaryType.value)?.label || ''; | 552 | // const dictionaryName = typeMap.value['dictionaryType'].find(item => item.value == dictionaryType.value)?.label || ''; |
| 553 | const dictionaryJson = dictionaryName && dictionaryName == currTableData.value.dictionaryName ? (currTableData.value.dictionaryJson || []) : []; | 553 | // const dictionaryJson = dictionaryName && dictionaryName == currTableData.value.dictionaryName ? (currTableData.value.dictionaryJson || []) : []; |
| 554 | // if (dictionaryType.value == '1') { | 554 | // if (dictionaryJson.length) { |
| 555 | // const tData = JSON.parse(JSON.stringify(mergeTableData)); | 555 | // dictionaryJson.map(item => { |
| 556 | // if (dictionaryJson.length) { | 556 | // tableData.value.push({ |
| 557 | // tData.map((item, i) => { | 557 | // label: item.name, |
| 558 | // item.factor = dictionaryJson[i]?.value || ''; | 558 | // factor: item.value || '', |
| 559 | // }) | 559 | // }) |
| 560 | // } | 560 | // }) |
| 561 | // tableData.value = tData; | ||
| 562 | // getMergeRow(); | ||
| 563 | // } else { | 561 | // } else { |
| 564 | if (dictionaryJson.length) { | 562 | // data.map((item: any) => { |
| 565 | dictionaryJson.map(item => { | 563 | // tableData.value.push({ |
| 566 | tableData.value.push({ | 564 | // label: item.label, |
| 567 | label: item.name, | 565 | // factor: '', |
| 568 | factor: item.value || '', | 566 | // }) |
| 569 | }) | 567 | // }) |
| 570 | }) | ||
| 571 | } else { | ||
| 572 | data.map((item: any) => { | ||
| 573 | tableData.value.push({ | ||
| 574 | label: item.label, | ||
| 575 | factor: '', | ||
| 576 | }) | ||
| 577 | }) | ||
| 578 | } | ||
| 579 | // } | 568 | // } |
| 569 | |||
| 570 | tableData.value = []; | ||
| 571 | const dictionaryName = typeMap.value['dictionaryType'].find(item => item.value == dictionaryType.value)?.label || ''; | ||
| 572 | const dictionaryJson = dictionaryName && dictionaryName == currTableData.value.dictionaryName ? (currTableData.value.dictionaryJson || []) : []; | ||
| 573 | |||
| 574 | // 创建已有数据的映射表,以 label 为键 | ||
| 575 | const existingDataMap = {}; | ||
| 576 | if (dictionaryJson.length) { | ||
| 577 | dictionaryJson.forEach(item => { | ||
| 578 | existingDataMap[item.name] = item.value || ''; | ||
| 579 | }); | ||
| 580 | } | ||
| 581 | |||
| 582 | // 遍历最新数据,如果有匹配的已有数据则使用其值 | ||
| 583 | data.forEach((item: any) => { | ||
| 584 | tableData.value.push({ | ||
| 585 | label: item.label, | ||
| 586 | factor: existingDataMap[item.label] || '', // 使用已有值或空字符串 | ||
| 587 | }); | ||
| 588 | }); | ||
| 580 | } | 589 | } |
| 581 | 590 | ||
| 582 | const getDictionaryRuleData = () => { | 591 | const getDictionaryRuleData = () => { |
| ... | @@ -833,6 +842,7 @@ const selectChange = async (val, row, info) => { | ... | @@ -833,6 +842,7 @@ const selectChange = async (val, row, info) => { |
| 833 | await setFormItems(tInfo, 'target'); | 842 | await setFormItems(tInfo, 'target'); |
| 834 | if (row.field == 'targetType') { | 843 | if (row.field == 'targetType') { |
| 835 | targetFormItems.value[3].default = val == '1' ? 'N' : 'Y'; | 844 | targetFormItems.value[3].default = val == '1' ? 'N' : 'Y'; |
| 845 | targetFormItems.value[4].default = val == '1' ? 'N' : 'Y'; | ||
| 836 | } | 846 | } |
| 837 | } | 847 | } |
| 838 | } | 848 | } |
| ... | @@ -1265,30 +1275,6 @@ onMounted(() => { | ... | @@ -1265,30 +1275,6 @@ onMounted(() => { |
| 1265 | <template v-if="showFactorTable"> | 1275 | <template v-if="showFactorTable"> |
| 1266 | <span class="required_mark" style="line-height: 21px;">字典值对应因子</span> | 1276 | <span class="required_mark" style="line-height: 21px;">字典值对应因子</span> |
| 1267 | <div class="table_panel"> | 1277 | <div class="table_panel"> |
| 1268 | <!-- <el-table border :data="tableData" :span-method="tableSpanMethod" tooltip-effect="light" style="height: 100%;" | ||
| 1269 | v-if="dictionaryType == '1'"> | ||
| 1270 | <el-table-column label="医院等级"> | ||
| 1271 | <el-table-column prop="level" label="级别" width="100" /> | ||
| 1272 | <el-table-column prop="grade" label="等次" width="100" /> | ||
| 1273 | </el-table-column> | ||
| 1274 | <el-table-column prop="factor" label="因子" class-name="edit-col"> | ||
| 1275 | <template #default="scope"> | ||
| 1276 | <el-input v-model="scope.row.factor" placeholder="请输入" | ||
| 1277 | @change="(val) => inputChange(val, scope, 'factor')" | ||
| 1278 | @input="(val) => inputEventChange(val, scope, 'factor')" /> | ||
| 1279 | </template> | ||
| 1280 | </el-table-column> | ||
| 1281 | </el-table> | ||
| 1282 | <el-table border :data="tableData" tooltip-effect="light" style="height: 100%;" v-else> | ||
| 1283 | <el-table-column label="字典名称" prop="label" width="140" /> | ||
| 1284 | <el-table-column prop="factor" label="因子" class-name="edit-col"> | ||
| 1285 | <template #default="scope"> | ||
| 1286 | <el-input v-model="scope.row.factor" placeholder="请输入" | ||
| 1287 | @change="(val) => inputChange(val, scope, 'factor')" | ||
| 1288 | @input="(val) => inputEventChange(val, scope, 'factor')" /> | ||
| 1289 | </template> | ||
| 1290 | </el-table-column> | ||
| 1291 | </el-table> --> | ||
| 1292 | <el-table border :data="tableData" tooltip-effect="light" style="height: 100%;"> | 1278 | <el-table border :data="tableData" tooltip-effect="light" style="height: 100%;"> |
| 1293 | <el-table-column label="字典名称" prop="label" width="140" /> | 1279 | <el-table-column label="字典名称" prop="label" width="140" /> |
| 1294 | <el-table-column prop="factor" label="因子" class-name="edit-col"> | 1280 | <el-table-column prop="factor" label="因子" class-name="edit-col"> | ... | ... |
-
Please register or sign in to post a comment