duy 2 жил өмнө
parent
commit
a02c02355e

+ 14 - 5
src/views/program/project/form.vue

@@ -282,7 +282,8 @@
             @save="updateChildPlanClick"
         >
             <template #extra>
-                <el-button size="large" type="primary" @click="addplan">
+                <el-button size="small" type="primary" @click="addplan">
+                    <HcIcon name="add" />
                     新增
                 </el-button>
             </template>
@@ -309,12 +310,14 @@
                 </template>
                 <template #action="{ row, index }">
                     <el-button size="small" type="danger" :disabled="row?.isShowDelete === 0" @click="delSubplan(row, index)">
+                        <HcIcon name="delete-bin" />
                         删除
                     </el-button>
                 </template>
             </HcTable>
             <template #footer>
                 <el-button type="primary" size="large" :loading="updateChildPlanLoading" @click="updateChildPlanClick">
+                    <HcIcon name="save" />
                     保存
                 </el-button>
             </template>
@@ -556,7 +559,15 @@ const tableSubplanData = ref([
 ])
 
 const subplanCloseClick = () => {
+    const arr = tableSubplanData.value
+    for (let i = arr.length - 1; i >= 0; i--) {
+        if (!arr[i].planTaskType || !arr[i].planTaskDesc || !arr[i].planTarget || !arr[i].planStartTime || !arr[i].planEndTime || !arr[i].planDays) {
+            arr.splice(i, 1)
+        }
+    }
     subplanModal.value = false
+
+    
 }
 
 const addplan = ()=>{
@@ -570,9 +581,7 @@ const addplan = ()=>{
 
     })
 }
-const changePlanTaskType = (val, row)=>{
-    console.log(val, row)
-    
+const changePlanTaskType = (val)=>{
     tableSubplanData.value.forEach((ele)=>{
         ele.planTaskType = val
         getWorkDays(ele)
@@ -651,7 +660,7 @@ const updateChildPlanClick = async ()=>{
     if (!error && code === 200) {
         window.$message.success(msg)
         tableData.value.forEach((ele)=>{
-            if (ele.id == subPlanItem.value.id) {
+            if (ele.id === subPlanItem.value.id) {
                 ele.childrenList = tableSubplanData.value
                 ele.planTarget = data.planTarget
                 ele.planTaskDesc = data.planTaskDesc