Commit 528b0b8649b1fc105fc09ca948bbc0352bd2946e

Authored by
2 parents 5debdf32 2d13a7d7

Merge branch 'zwl-develop' into 'develop'

fix: 系统配置提成成本配置编辑表单逻辑修改



See merge request !16
src/views/project/config/costEdit.vue
@@ -32,25 +32,32 @@ @@ -32,25 +32,32 @@
32 const emit = defineEmits(['success']); 32 const emit = defineEmits(['success']);
33 33
34 const [register, { closeDrawer }] = useDrawerInner((data) => { 34 const [register, { closeDrawer }] = useDrawerInner((data) => {
  35 + // 先重置所有字段
  36 + fixCost.value = '';
  37 + ratio.value = '';
  38 + spainRatio.value = '';
  39 + copyCommission.value = '';
  40 + year.value = '';
  41 +
  42 + // 再赋值新数据
35 listAll.value = data.data; 43 listAll.value = data.data;
36 relationValue.value = JSON.parse(listAll.value.relationValue); 44 relationValue.value = JSON.parse(listAll.value.relationValue);
37 - fixCost.value = relationValue.value[0].relationValue;  
38 - // 将小数转换为百分比格式显示  
39 - ratio.value = relationValue.value[1].relationValue  
40 - ? (parseFloat(relationValue.value[1].relationValue) * 100).toFixed(2) + '%' 45 + fixCost.value = relationValue.value[0]?.relationValue || '';
  46 + ratio.value = relationValue.value[1]?.relationValue
  47 + ? (parseFloat(relationValue.value[1].relationValue) * 100).toFixed(2) + '%'
41 : ''; 48 : '';
42 - spainRatio.value = relationValue.value[2].relationValue  
43 - ? (parseFloat(relationValue.value[2].relationValue) * 100).toFixed(2) + '%' 49 + spainRatio.value = relationValue.value[2]?.relationValue
  50 + ? (parseFloat(relationValue.value[2].relationValue) * 100).toFixed(2) + '%'
44 : ''; 51 : '';
45 - copyCommission.value = relationValue.value[3].relationValue;  
46 - year.value = listAll.value.relationName; 52 + copyCommission.value = relationValue.value[3]?.relationValue || '';
  53 + year.value = listAll.value.relationName || '';
47 }); 54 });
48 //获取现有的列表 55 //获取现有的列表
49 const listAll = ref(); 56 const listAll = ref();
50 const fixCost = ref(); 57 const fixCost = ref();
51 const ratio = ref(); 58 const ratio = ref();
52 const spainRatio = ref(); 59 const spainRatio = ref();
53 - const copyCommission = ref(''); 60 + const copyCommission = ref();
54 const relationValue = ref(); 61 const relationValue = ref();
55 const year = ref(); 62 const year = ref();
56 63