Procházet zdrojové kódy

项目计划修改

duy před 2 roky
rodič
revize
e701503fc7
1 změnil soubory, kde provedl 34 přidání a 28 odebrání
  1. 34 28
      src/views/program/project/form.vue

+ 34 - 28
src/views/program/project/form.vue

@@ -18,7 +18,7 @@
         <HcTable :isIndex="false" :column="tableColumn" :datas="tableData" :row-style="tableRowStyle" hasChildren="hasChildren1" children="childrenList">
             <template #projectProcessValue="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.projectProcessValue}}</span>
                         </template>
@@ -29,7 +29,7 @@
 
             <template #budgetTypeValue="{row,index}">
                <template v-if="row.taskFinishedStatus === 1">
-                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                        <template #reference>
                            <span class="text-hover">{{row.budgetTypeValue}}</span>
                        </template>
@@ -39,7 +39,7 @@
            </template>
            <template #taskDetailValue="{row,index}">
                <template v-if="row.taskFinishedStatus === 1">
-                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                        <template #reference>
                            <span class="text-hover">{{row.taskDetailValue}}</span>
                        </template>
@@ -49,7 +49,7 @@
            </template>
            <template #planTaskType="{row,index}">
                <template v-if="row.taskFinishedStatus === 1">
-                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                     <template #reference>
                         <el-select v-model="row.planTaskType" v-if="row.isEdit" clearable>
                                 <el-option v-for="item in taskTypeList" :label="item.dictName" :value="item.id" />
@@ -68,7 +68,7 @@
            </template>
            <template #planTaskDesc="{row,index}">
                <template v-if="row.taskFinishedStatus === 1">
-                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template  #reference>
                             <el-input v-model="row.planTaskDesc" v-if="row.isEdit" clearable/>
                             <span v-else>{{row.planTaskDesc}}</span>
@@ -82,7 +82,7 @@
            </template>
            <template #planTarget="{row,index}">
                <template v-if="row.taskFinishedStatus === 1">
-                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                        <template #reference>
                             <el-input v-model="row.planTarget" v-if="row.isEdit" clearable/>
                             <span v-else>{{row.planTarget}}</span>
@@ -96,7 +96,7 @@
            </template>
             <template #key7="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                        <template #reference>
                             <HcDatePicker :dates="[row.planStartTime,row.planEndTime]" @change="betweenTimeUpdate($event,row)" v-if="row.isEdit" clearable/>
                             <span v-else>
@@ -117,12 +117,12 @@
                 </span>
             </template>
             <!-- <template #planDays="{row,index}">
-                <el-input v-model="row.planDays" v-if="row.isEdit" disabled clearable/>
+                <el-input v-model="row.planDays" v-if="row.isEdit"  />
                 <span v-else>{{row.planDays}}</span>
             </template> -->
-            <template #planDays="{row,index}">
+            <template #planDays="{row,index}" >
                <template v-if="row.taskFinishedStatus === 1">
-                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                   <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                        <template #reference>
                         <el-input v-model="row.planDays" v-if="row.isEdit" disabled clearable/>
                          <span v-else>{{row.planDays}}</span>
@@ -136,7 +136,7 @@
            </template>
            <template #postTypeValue="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.postTypeValue}}</span>
                         </template>
@@ -146,7 +146,7 @@
             </template>
             <template #staffCount="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.staffCount}}</span>
                         </template>
@@ -156,7 +156,7 @@
             </template>
             <template #budgetStaffCost="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.budgetStaffCost}}</span>
                         </template>
@@ -166,7 +166,7 @@
             </template>
             <template #budgetTravelExpense="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.budgetTravelExpense}}</span>
                         </template>
@@ -176,7 +176,7 @@
             </template>
             <template #outsourceUnitPrice="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.outsourceUnitPrice}}</span>
                         </template>
@@ -186,7 +186,7 @@
             </template>
             <template #outsourcePeopleCount="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.outsourcePeopleCount}}</span>
                         </template>
@@ -196,7 +196,7 @@
             </template>
             <template #outsourceCountMoney="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.outsourceCountMoney}}</span>
                         </template>
@@ -206,7 +206,7 @@
             </template>
             <template #otherBudgetMoney="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.otherBudgetMoney}}</span>
                         </template>
@@ -216,7 +216,7 @@
             </template>
             <template #budgetCountMoney="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.budgetCountMoney}}</span>
                         </template>
@@ -226,7 +226,7 @@
             </template>
             <template #budgetRemark="{row,index}">
                 <template v-if="row.taskFinishedStatus === 1">
-                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="'成本增加! 该项计划完成时间超出当初测算工作时长 1天)'">
+                    <el-popover placement="top-start" title="" :width="200" :hide-after="0" :content="row?.outMoneyTips">
                         <template #reference>
                             <span class="text-hover">{{row.budgetRemark}}</span>
                         </template>
@@ -309,7 +309,7 @@
 <script setup>
 
 import {useRouter, useRoute} from 'vue-router'
-import {onActivated, ref,watch} from "vue";
+import {onActivated, ref,watch,getCurrentInstance} from "vue";
 import projectApi from '~api/program/project.js';
 import contractApi from '~api/project/project-contract.js';
 import {getArrValue,getObjValue} from "js-fast-way"
@@ -481,6 +481,12 @@ const betweenTimeUpdate = ({arr, query},item) => {
     item.planStartTime=arr[0]
     item.planEndTime=arr[1]
     item.betweenTime=arr
+    // if(arr.length>0){
+    //     item.planDays=null
+    //      getWorkDays(item)
+    // }else{
+    //     item.planDays=null
+    // }
 }
 //日期时间被选择
 const subbetweenTime = ref(null)
@@ -565,25 +571,25 @@ const getWorkDays=async(row)=>{
   
  
 }
+
 //编辑主计划
 const updateMainPlanClick=async(row)=>{
-    row.isEdit = false
     const {planTaskType}=row
     taskTypeList.value.forEach((ele)=>{
         if(ele.id===planTaskType){
             row.planTaskTypeValue=ele.dictName
         }
     })
-    console.log(tableData.value,'tableData');
     const {error, code, data,msg} = await projectApi.updateMainPlan( 
         row
     )
     if (!error && code === 200) {
-        if(data){
-            row=getObjValue(data)
-            console.log(data,'data');
-        }
-    
+        
+       if(data){
+            row.planDays=data.planDays
+            row.isEdit=false
+       }
+       
     }
 
 }