Prechádzať zdrojové kódy

项目删除接口调用

duy 7 mesiacov pred
rodič
commit
1707a7a7bb

+ 2 - 2
src/api/modules/project/project.js

@@ -53,9 +53,9 @@ export default {
     //删除
     async del(ids) {
         return HcApi({
-            url: '/api/blade-attach/project/remove',
+            url: '/api/blade-attach/project/delete',
             method: 'post',
-            params: { ids },
+            data: { ids },
         }, false)
     },
 }

+ 2 - 0
src/views/project/admin/list.vue

@@ -169,7 +169,9 @@ const delTableItem = async (_, resolve) => {
         resolve()
         searchClick()
     } else {
+      
         window.$message.error(msg ?? '删除失败')
+        resolve()
     }
 }
 

+ 26 - 6
src/views/project/modules/project-list.vue

@@ -17,7 +17,7 @@
         </hc-table>
         <!-- 查看详情 -->
         <hc-drawer v-model="isDrawer" to-id="hc-main-box" is-close>
-            <hc-card class="hc-project-list-drawer">
+            <hc-card class="hc-project-list-drawer" :scrollbar="true">
                 <template #header>
                     <div class="flex-1 text-center text-[24px] font-bold">项目详情</div>
                 </template>
@@ -86,7 +86,7 @@
                                     <el-table-column prop="investMoney" label="投资完成额(亿元)" width="100" align="center" />
                                     <el-table-column prop="investUnfinishedMoney" label="投资未完成额(亿元)" width="100" align="center" />
                                     <el-table-column prop="yearlyTarget" label="全年目标" width="100" align="center" />
-                                    <el-table-column prop="workPlan	" label="工作计划" width="100" align="center" />
+                                    <el-table-column prop="workPlan" label="工作计划" width="100" align="center" />
                                     <el-table-column prop="workProgressAll" label="累计进展计划" align="center" />
                                
                                     <el-table-column prop="workProgress" label="工作计划进展计划" align="center" />
@@ -125,7 +125,7 @@
 
         <!-- 项目完成情况 -->
         <hc-drawer v-model="isCompletionDrawer" to-id="hc-main-box" is-close>
-            <hc-card class="hc-project-list-drawer" is-action-btn>
+            <hc-card class="hc-project-list-drawer" is-action-btn :scrollbar="true">
                 <template #header>
                     <div class="flex-1 text-center text-[24px] font-bold">项目完成情况</div>
                 </template>
@@ -167,7 +167,7 @@
                                         <template #default="{ row, $index }">
                                             <hc-body>
                                                 <!-- <hc-table-input v-model="row.investMoney" /> -->
-                                                <el-input v-model="row.investMoney" clearable :formatter="formatInput" @change="changeInvestMoney($event, row, $index)" />
+                                                <el-input v-model="row.investMoney" clearable :formatter="formatInput" :disabled="!row.planInvestMoney" @change="changeInvestMoney($event, row, $index)" />
                                             </hc-body>
                                         </template>
                                     </el-table-column>
@@ -200,9 +200,10 @@
                                         </template>
                                     </el-table-column>
                                     <el-table-column prop="planRatio" label="形象进度百分比(%)" width="100" align="center">
-                                        <template #default="{ row }">
+                                        <template #default="{ row, $index }">
                                             <hc-body>
-                                                <hc-table-input v-model="row.planRatio" :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" />
+                                                <!-- <hc-table-input v-model="row.planRatio" :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" /> -->
+                                                <el-input v-model="row.planRatio" :disabled="yearData.list[yearIndex].isCanFill === 1 ? false : true" :formatter="formatInput" @change="changePlanRatio($enent, row, $index)" />
                                             </hc-body>
                                         </template>
                                     </el-table-column>
@@ -367,7 +368,9 @@ const delTableItem = async ({ item }, resolve) => {
         resolve()
         emit('change')
     } else {
+
         window.$message.error(msg ?? '删除失败')
+        resolve()
     }
 }
 //关闭抽屉
@@ -532,6 +535,23 @@ const changeInvestMoney = (val, row, index)=>{
         }
     })
 }
+const changePlanRatio = (val, row, index)=>{
+    let table = yearData.value.list[yearIndex.value].list
+    if (index > 0) {
+        let topVal = Number(table[index - 1].planRatio)
+        if (Number(row.planRatio) < topVal) {
+            window.$message.warning('形象进度百分比:每季度应为增加情况,当月不得低于上月')
+            row.planRatio = ''
+        }
+    } else if (index === 0) {
+        let nextVal = Number(table[index + 1].planRatio)
+        if (nextVal > 0 && Number(row.planRatio) > nextVal) {
+            window.$message.warning('形象进度百分比:每季度应为增加情况,当月不得低于上月')
+            row.planRatio = ''
+        }
+    }
+   
+}
 defineExpose({
     batchRemove,
     batchExport,