ZaiZai 1 year ago
parent
commit
fea4983ef3
3 changed files with 16 additions and 2 deletions
  1. 1 1
      public/version.json
  2. 8 0
      src/api/modules/funding/index.js
  3. 7 1
      src/views/funding/plan.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240617175318"
+  "value": "20240621184204"
 }

+ 8 - 0
src/api/modules/funding/index.js

@@ -41,4 +41,12 @@ export default {
             params: form,
         })
     },
+    //删除资金预算期
+    async deleteById(formPeriodId) {
+        return HcApi({
+            url: '/api/blade-meter/formPeriod/deleteById',
+            method: 'get',
+            params: { formPeriodId },
+        })
+    },
 }

+ 7 - 1
src/views/funding/plan.vue

@@ -134,13 +134,19 @@ const saveRowClick = async () => {
 }
 
 //删除数据
-const delRowClick = ({ citeStatus }, index) => {
+const delRowClick = ({ id, citeStatus }, index) => {
     if (citeStatus === 1) {
         window?.$message?.warning('当前数据已被计量,不允许删除')
         return
     }
     //删除弹窗
     HcDelMsg(async (resolve) => {
+        const { error, code } = await mainApi.deleteById(id)
+        if (error && code !== 200) {
+            resolve() //关闭弹窗的回调
+            return
+        }
+        window?.$message?.success('操作成功')
         const rows = tableData.value
         rows.splice(index, 1)
         isAddModal.value = true