Browse Source

创建项目修改

duy 7 months ago
parent
commit
2be440ab85
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/views/project/admin/create.vue

+ 7 - 2
src/views/project/admin/create.vue

@@ -108,7 +108,7 @@
             <el-form :model="yearOptions[selectIndex].yearForm" label-width="auto" class="mt-3" label-position="left" size="large" :disabled="!selectYear">
                 <el-form-item label="全年计划投资:" prop="yearlyInvest" class="w-100">
                     <el-input
-                        v-model="yearOptions[selectIndex].yearForm.yearlyInvest" placeholder="请输入" clearable
+                        v-model="yearOptions[selectIndex].yearForm.yearlyInvest" placeholder="请输入" clearable :disabled="isChangeyearlyInvest"
                         :formatter="formatInput"
                     >
                         <template #append>亿元</template>
@@ -362,7 +362,7 @@ const formatInput = (value)=>{
       } 
 }
 
-
+const isChangeyearlyInvest = ref(false)
 //监听
 watch(() => [
 yearOptions.value[selectIndex.value].yearForm.oneInvest,
@@ -370,6 +370,11 @@ yearOptions.value[selectIndex.value].yearForm.twoInvest,
 yearOptions.value[selectIndex.value].yearForm.threeInvest,
 yearOptions.value[selectIndex.value].yearForm.fourInvest,
 ], ([key2, key3, key4, key5]) => {
+    if ( Number(key2) > 0 || Number(key3) > 0 || Number(key4) > 0 || Number(key5) > 0) {
+        isChangeyearlyInvest.value = true
+    } else {
+        isChangeyearlyInvest.value = false
+    }
     yearOptions.value[selectIndex.value].yearForm.yearlyInvest = Number(key2) + Number(key3) + Number(key4) + Number(key5)
     const totalYearlyInvest = yearOptions.value.reduce((accumulator, currentValue) => {
         return accumulator + currentValue.yearForm.yearlyInvest