Bladeren bron

调整撤回

luojun 2 jaren geleden
bovenliggende
commit
660287ac69
2 gewijzigde bestanden met toevoegingen van 29 en 12 verwijderingen
  1. 7 0
      src/api/resumption/plan.js
  2. 22 12
      src/views/resumption/plan/index.vue

+ 7 - 0
src/api/resumption/plan.js

@@ -24,6 +24,13 @@ export function cheHui(id) {
   })
 }
 // 查询【请填写功能名称】详细
+export function distributeCheHui(id) {
+  return request({
+    url: '/core/api/plan/distributeCheHui/' + id,
+    method: 'get'
+  })
+}
+// 查询【请填写功能名称】详细
 export function distribute(query) {
   return request({
     url: '/core/api/plan/distribute' ,

+ 22 - 12
src/views/resumption/plan/index.vue

@@ -428,11 +428,12 @@ export default {
     //已完成下发的计划不显示下发按钮
     checkCanPublish(row) {
       // console.log(row.planOfOrgType,"row.planOfOrgType")
-      if (row.planOfOrgType == "1" && (row.distribute == null||row.distribute == 2)) {
+      if (row.planOfOrgType == "1" && row.distribute == 0) {
         return true;
       }
       return false;
     },
+    //开始撤回
     chhuile(row) {
       this.loading = true;
       api.cheHui(row.id).then((response) => {
@@ -440,8 +441,9 @@ export default {
         this.loading = false;
       });
     },
+    //已下发的显示撤回
     chehui(row) {
-      if (row.planOfOrgType == "1" && row.distribute == 1) {
+      if (row.distribute == 1) {
         return true;
       }
       return false;
@@ -492,17 +494,25 @@ export default {
       this.$refs.editDialog.show(id, other);
     },
     showDialogDistribute(row) {
-      api.cheHui(row.id).then((response) => {
-        console.log(response.data,"appPlanService.cheHui(id);")
-        if(response.data!=1){
-          this.$refs.dialogDistribute.show(row);
-        }else{
-          this.getList();
-        }
-          
-          
+      this.loading = true;
+      api
+        .distributeCheHui(row.id)
+        .then((response) => {
+          // console.log(response, "then");
+          if (response.data == 0) {
+            this.loading = false;
+            this.$refs.dialogDistribute.show(row);
+          } else {
+            this.getList();
+            this.loading = false;
+          }
         })
-      
+        .catch((response) => {
+          // console.log(response, "catch");
+          this.getList();
+          this.loading = false;
+          this.$refs.dialogDistribute.show(row);
+        });
     },
     async onDel(id, name) {
       this.$modal