ソースを参照

目标管理-所有模块增加提交收回时改变状态。

DongZ 1 年間 前
コミット
c62bb94d4d

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

@@ -1160,6 +1160,7 @@
           if (code === 200) {
             this.$modal.notifySuccess("提交成功");
             this.$modal.closeLoading();
+            row.status = '1';
           }
         } catch (err) {
           console.error(err);
@@ -1182,7 +1183,7 @@
           if (res.code === 200) {
             this.$modal.notifySuccess("收回成功");
             this.$modal.closeLoading();
-            this.getList(this.queryParams)
+            row.status = '0';
           }
         }).catch(err => {
           this.$message.error(err);

+ 1 - 0
src/views/business/spd/target/AnnualSaleGoalMerge.vue

@@ -1588,6 +1588,7 @@
           if (res.code === 200) {
             this.$modal.notifySuccess("收回成功");
             this.$modal.closeLoading();
+            row.status = '0';
           }
         }).catch(err => {
           this.$message.error(err);

+ 1 - 0
src/views/business/spd/target/MonthGoalMerge.vue

@@ -1406,6 +1406,7 @@
           if (res.code === 200) {
             this.$modal.notifySuccess("收回成功");
             this.$modal.closeLoading();
+            row.status = '0';
           }
         }).catch(err => {
           this.$message.error(err);

+ 1 - 0
src/views/business/spd/target/MonthReturnGoal.vue

@@ -1056,6 +1056,7 @@
           if (res.code === 200) {
             this.$modal.notifySuccess("收回成功");
             this.$modal.closeLoading();
+            row.status = '0';
           }
         }).catch(err => {
           this.$message.error(err);

+ 1 - 0
src/views/business/spd/target/MonthReturnMerge.vue

@@ -1019,6 +1019,7 @@
           if (res.code === 200) {
             this.$modal.notifySuccess("收回成功");
             this.$modal.closeLoading();
+            row.status = '0';
           }
         }).catch(err => {
           this.$message.error(err);

+ 7 - 10
src/views/business/spd/target/MonthSaleGoal.vue

@@ -1244,22 +1244,18 @@
         this.dialogUpdateMore.updateData = null
       },
       //提交
-      async handleSubmit(row) {
+      handleSubmit(row) {
         this.$modal.loading("提交中...");
-        try {
-          const {
-            msg,
-            code
-          } = await submit(row.id);
-          if (code === 200) {
+        submit(row.id).then(res => {
+          if (res.code === 200) {
             this.$modal.notifySuccess("提交成功");
             this.$modal.closeLoading();
             row.status = '1';
           }
-        } catch (err) {
-          console.error(err);
+        }).catch(err => {
+          this.$message.error(err);
           this.$modal.closeLoading();
-        }
+        })
       },
       //收回
       handleReback(row) {
@@ -1277,6 +1273,7 @@
           if (res.code === 200) {
             this.$modal.notifySuccess("收回成功");
             this.$modal.closeLoading();
+            row.status = '0';
           }
         }).catch(err => {
           this.$message.error(err);

+ 1 - 0
src/views/business/spd/target/targetMk/index.vue

@@ -247,6 +247,7 @@
           if (res.code === 200) {
             this.$modal.notifySuccess("收回成功");
             this.$modal.closeLoading();
+            row.status = '0';
           }
         }).catch(err => {
           this.$message.error(err);