Răsfoiți Sursa

编辑子计划修改

duy 2 ani în urmă
părinte
comite
70d14be33f
1 a modificat fișierele cu 10 adăugiri și 7 ștergeri
  1. 10 7
      src/views/program/project/form.vue

+ 10 - 7
src/views/program/project/form.vue

@@ -282,15 +282,13 @@
               
                 </template>
                 <template #planDays="{row,index}" >
-                    
-                    <el-input v-model="row.planDays" disabled  clearable  />
-                  
+                    <el-input v-model="row.planDays" disabled  clearable />
                 </template>
                 <template #key9="{row,index}">
                     <el-input v-model="row.key9" clearable/>
                 </template>
                 <template #action="{row,index}">
-                <el-button size="small" type="primary" @click="delSubplan(row,index)">删除</el-button>
+                <el-button size="small" type="primary" @click="delSubplan(row,index)" :disabled="row?.isShowDelete===0">删除</el-button>
             </template>
             </HcTable>
         </HcDialog>
@@ -491,6 +489,11 @@ const subbetweenTimeUpdate = ({arr, query},item) => {
     item.planStartTime=arr[0]
     item.planEndTime=arr[1]
     item.subbetweenTime=arr
+    if(arr.length>0){
+         getWorkDays(item)
+    }else{
+        item.planDays=null
+    }
 }
 
 const subplanModal = ref(false)
@@ -560,11 +563,13 @@ const relatedModalShow = (row) => {
 const getWorkDays=async(row)=>{
  
         if(row?.planStartTime&&row?.planEndTime){
+         
             const {error, code, data,msg} = await projectApi.getWorkDays( {
                 startDate:row.planStartTime,
                 endDate:row.planEndTime,
             
             })
+      
             if (!error && code === 200) {
                 if(data){
                     row.planDays=data
@@ -601,12 +606,10 @@ const updateMainPlanClick=async(row)=>{
 //编辑子计划传入父级
 const updateChildPlanClick=async()=>{
     subPlanItem.value.childrenList=tableSubplanData.value
-
-    const {error, code, data,msg} = await projectApi.updateMainPlan( 
+    const {error, code, data,msg} = await projectApi.updateChildrenPlan( 
         subPlanItem.value,
     )
     if (!error && code === 200) {
-
         window.$message.success(msg)
         tableData.value.forEach((ele)=>{
             if(ele.id==subPlanItem.value.id){