Эх сурвалжийг харах

目标管理-年销售目标填报增加重新提交按钮,还没改完。

DongZ 1 жил өмнө
parent
commit
157fe1dd79

+ 9 - 0
src/api/business/spd/goal_management/annualSaleGoal.js

@@ -50,4 +50,13 @@ export function submit(id) {
     method: 'post',
     data: id
   })
+}
+
+//重新提交
+export function resubmit(id) {
+  return request({
+    url: '/goal_management/annualSaleGoal/resubmit',
+    method: 'post',
+    data: id
+  })
 }

+ 24 - 1
src/views/business/spd/target/AnnualSaleGoal.vue

@@ -137,9 +137,12 @@
           <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
             @click="handleDelete(scope.row)">删除
           </el-button>
-          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" size="mini" type="text"
+          <el-button v-if="scope.row.status == '0' && (scope.row.flowId == null || scope.row.flowId == '')" size="mini" type="text"
             @click="handleSubmit(scope.row)">提交
           </el-button>
+          <el-button v-if="(scope.row.status == '0' || scope.row.status == '3') && !(scope.row.flowId == null || scope.row.flowId == '')" size="mini" type="text"
+            @click="handleResubmit(scope.row)">重新提交
+          </el-button>
           <el-button v-if="scope.row.status == '1'" size="mini" type="text" @click="handleReback(scope.row)">收回
           </el-button>
         </template>
@@ -659,6 +662,7 @@
     addAnnualSaleGoal,
     updateAnnualSaleGoal,
     submit,
+    resubmit,
   } from "@/api/business/spd/goal_management/annualSaleGoal";
   import {
     delAnnualSaleGoalDetails,
@@ -1321,6 +1325,25 @@
           this.$modal.closeLoading();
         }
       },
+      //重新提交
+      async handleResubmit(row) {
+        this.$modal.loading("提交中...");
+        try {
+          const {
+            msg,
+            code
+          } = await resubmit(row.id);
+          if (code === 200) {
+            this.$modal.notifySuccess("提交成功");
+            this.$modal.closeLoading();
+            row.status = '1'
+            // this.getList(this.queryParams)
+          }
+        } catch (err) {
+          console.error(err);
+          this.$modal.closeLoading();
+        }
+      },      
       //收回
       handleReback(row) {
         this.$modal.loading("收回中...");