Prechádzať zdrojové kódy

分解子计划保存

duy 2 rokov pred
rodič
commit
f2996e2696
1 zmenil súbory, kde vykonal 18 pridanie a 10 odobranie
  1. 18 10
      src/views/program/project/form.vue

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

@@ -32,12 +32,12 @@
                 <span v-else>{{row.planTarget}}</span>
             </template>
             <template #key7="{row,index}">
-                <HcDatePicker :dates="row?.betweenTime" @change="betweenTimeUpdate($event,row)" v-if="row.isEdit"/>
+                <HcDatePicker :dates="[row.planStartTime,row.planEndTime]" @change="betweenTimeUpdate($event,row)" v-if="row.isEdit"/>
                 <!-- <span v-else>{{row.key7}}</span> -->
                 <span v-else>
-                    <span >{{row.planStartDate?row.planStartDate:''}}</span>
-                    <span  v-if="row.planStartDate">~</span>
-                    <span >{{row.planStartDate?row.planStartDate:''}}</span>
+                    <span >{{row.planStartTime?row.planStartTime:''}}</span>
+                    <span  v-if="row.planEndTime">~</span>
+                    <span >{{row.planEndTime?row.planEndTime:''}}</span>
                 </span>
              
       
@@ -188,7 +188,7 @@ const tabChange = ({key}) => {
     }else if(key=='construction'){
         tableData.value=constructionData.value.length>0?constructionData.value:originTableData.value
         detailData.value.constructUnit=tableData.value
-        console.log( formBaseModel.value.constructUnit,' formBaseModel.value.constructUnit');
+      
     }else if(key=='bulid'){
         console.log(buildData.value,'=buildData.value');
         tableData.value=buildData.value.length>0?buildData.value:originTableData.value
@@ -258,10 +258,8 @@ const tableRowStyle = ({row, rowIndex}) => {
 //日期时间被选择
 const betweenTime = ref(null)
 const betweenTimeUpdate = ({arr, query},item) => {
-    betweenTime.value = arr
-    betweenTime.value = arr
-    item.planStartDate=arr[0]
-    item.planEndtDate=arr[1]
+    item.planStartTime=arr[0]
+    item.planEndTime=arr[1]
     item.betweenTime=arr
 }
 //日期时间被选择
@@ -274,10 +272,13 @@ const subbetweenTimeUpdate = ({arr, query},item) => {
 }
 
 const subplanModal = ref(false)
+const subPlanItem=ref({})
 const subplanModalShow = (row) => {
     console.log(row,'row');
+    subPlanItem.value=row
     subplanModal.value = true
     tableSubplanData.value=row?.childrenList||[]
+
 }
 //表格
 const tableSubplanColumn = [
@@ -302,8 +303,15 @@ const tableSubplanData = ref([
 const subplanCloseClick = () => {
     subplanModal.value = false
 }
-
+//分解子计划保存
 const subplanSaveClick = () => {
+    tableData.value.forEach((ele)=>{
+        if(ele.id==subPlanItem.id){
+            ele.childrenList=tableSubplanData.value
+        }
+    })
+    subplanModal.value = false
+    // subPlanItem.value.childrenList=tableSubplanData.value
 
 }