yusheng 11 месяцев назад
Родитель
Сommit
cb17c756c0

+ 3 - 2
src/views/bpm/handleTask/components/businessOpportunity/submit.vue

@@ -112,7 +112,7 @@
     UpdateInformation,
     cancel
   } from '@/api/bpm/components/saleManage/businessOpportunity';
-  import { approveTaskWithVariables, rejectTask } from '@/api/bpm/task';
+  import { approveTaskWithVariables, rejectTask,cancelTask } from '@/api/bpm/task';
   import { listAllUserBind } from '@/api/system/organization';
   // 流程实例的详情页,可用于审批
   export default {
@@ -333,8 +333,9 @@
             confirmButtonText: '确定'
           })
             .then(() => {
-              cancel({
+              cancelTask({
                 id: this.taskId,
+                taskId: this.taskId,
                 reason: this.form.reason,
                 businessId: this.businessId
               })

+ 4 - 3
src/views/bpm/handleTask/components/certificateQualifications/submit.vue

@@ -52,7 +52,7 @@
 
 <script>
   import { cancel } from '@/api/bpm/components/supplierManage/contact';
-  import { approveTaskWithVariables, rejectTask } from '@/api/bpm/task';
+  import { approveTaskWithVariables, rejectTask,cancelTask } from '@/api/bpm/task';
   import { listAllUserBind } from '@/api/system/organization';
 
   // 流程实例的详情页,可用于审批
@@ -143,8 +143,9 @@
             confirmButtonText: '确定'
           })
             .then(() => {
-              cancel({
-                id: this.taskId,
+              cancelTask({
+                id: this.id,
+                taskId: this.taskId,
                 reason: this.form.reason,
                 businessId: this.businessId
               })

+ 4 - 3
src/views/bpm/handleTask/components/changeManage/submit.vue

@@ -48,7 +48,7 @@
 
 <script>
   import { UpdateInformation, cancel } from '@/api/bpm/components/contractManage/contractBook';
-  import {approveTaskWithVariables, rejectTask} from '@/api/bpm/task';
+  import {approveTaskWithVariables, rejectTask,cancelTask} from '@/api/bpm/task';
   import { listAllUserBind } from '@/api/system/organization';
 
   // 流程实例的详情页,可用于审批
@@ -134,8 +134,9 @@
             cancelButtonText: '取消',
             confirmButtonText: '确定'
           }).then(() => {
-            cancel({
-              id: this.taskId,
+            cancelTask({
+              id: this.id,
+              taskId: this.taskId,
               reason: this.form.reason,
               businessId: this.businessId,
             }).then(() => {

+ 107 - 74
src/views/bpm/handleTask/components/changeManagement/submit.vue

@@ -3,7 +3,6 @@
     <el-form label-width="100px" ref="formRef" :model="form">
       <el-form-item
         label="审批建议"
- 
         style="margin-bottom: 20px"
         :rules="{
           required: true,
@@ -35,7 +34,7 @@
         v-if="taskDefinitionKey != 'starter'"
         >驳回
       </el-button>
-      <!-- <el-dropdown
+      <el-dropdown
         @command="(command) => handleCommand(command)"
         style="margin-left: 30px"
       >
@@ -45,92 +44,126 @@
         <el-dropdown-menu slot="dropdown">
           <el-dropdown-item command="cancel">作废</el-dropdown-item>
         </el-dropdown-menu>
-      </el-dropdown> -->
+      </el-dropdown>
     </div>
   </el-col>
 </template>
 
 <script>
-import {approveTaskWithVariables, rejectTask} from '@/api/bpm/task';
-import dictMixins from '@/mixins/dictMixins';
-import { questionSave } from '@/api/bpm/components/changeManagement/question';
-import { requestSave } from '@/api/bpm/components/changeManagement/request';
-import { noticeSave } from '@/api/bpm/components/changeManagement/notice';
-// import {
-//   assign,
-//   cancel
-// } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
+  import {
+    approveTaskWithVariables,
+    rejectTask,
+    cancelTask
+  } from '@/api/bpm/task';
+  import dictMixins from '@/mixins/dictMixins';
+  import { questionSave } from '@/api/bpm/components/changeManagement/question';
+  import { requestSave } from '@/api/bpm/components/changeManagement/request';
+  import { noticeSave } from '@/api/bpm/components/changeManagement/notice';
+  // import {
+  //   assign,
+  //   cancel
+  // } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
 
-// 流程实例的详情页,可用于审批
-export default {
-  mixins: [dictMixins],
+  // 流程实例的详情页,可用于审批
+  export default {
+    mixins: [dictMixins],
 
-  name: '',
-  components: {
-    //   Parser
-  },
-  props: {
-    businessId: {
-      default: ''
+    name: '',
+    components: {
+      //   Parser
     },
-    taskId: {
-      default: ''
-    },
-    id: {
-      default: ''
-    },
-    taskDefinitionKey: {
-      default: ''
-    }
-  },
-  data() {
-    return {
-      form: {
-        reason: ''
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
       }
-    };
-  },
-  created() {},
-  methods: {
-    async handleAudit(status) {
-      //申请人申请
-      if (this.taskDefinitionKey === 'starter') {
-        const data = await this.getTableValue();
-        let api=data.objType==1?questionSave:data.objType==2?requestSave:noticeSave
-        // return
-        if (data) {
-          await api(data);
-        }
-      }
-      await this._approveTaskWithVariables(status);
     },
-    async _approveTaskWithVariables(status) {
-      let variables = {
-        pass: !!status
-      };
-      let API = !!status ? approveTaskWithVariables : rejectTask;
-      API({
-        id: this.taskId,
-        reason: this.form.reason,
-        variables
-      }).then((res) => {
-        if (res.data.code != '-1') {
-          this.$emit('handleAudit', {
-            status,
-            title: status === 0 ? '驳回' : ''
-          });
+    data() {
+      return {
+        form: {
+          reason: ''
         }
-      });
+      };
     },
-    getTableValue() {
-      return new Promise((resolve, reject) => {
-        this.$emit('getTableValue', async (data) => {
-          resolve(await data);
+    created() {},
+    methods: {
+      async handleAudit(status) {
+        //申请人申请
+        if (this.taskDefinitionKey === 'starter') {
+          const data = await this.getTableValue();
+          let api =
+            data.objType == 1
+              ? questionSave
+              : data.objType == 2
+              ? requestSave
+              : noticeSave;
+          // return
+          if (data) {
+            await api(data);
+          }
+        }
+        await this._approveTaskWithVariables(status);
+      },
+      async _approveTaskWithVariables(status) {
+        let variables = {
+          pass: !!status
+        };
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        API({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      },
+      //更多
+      handleCommand(command) {
+        if (command === 'cancel') {
+          this.$confirm('是否确认作废?', {
+            type: 'warning',
+            cancelButtonText: '取消',
+            confirmButtonText: '确定'
+          })
+            .then(() => {
+              cancelTask({
+                id: this.id,
+                taskId: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
+        }
+      },
+      getTableValue() {
+        return new Promise((resolve, reject) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
         });
-      });
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss"></style>

+ 4 - 3
src/views/bpm/handleTask/components/contractBook/submit.vue

@@ -70,7 +70,7 @@
 
 <script>
   import { UpdateInformation, cancel } from '@/api/bpm/components/contractManage/contractBook';
-  import {approveTaskWithVariables, rejectTask} from '@/api/bpm/task';
+  import {approveTaskWithVariables, rejectTask,cancelTask} from '@/api/bpm/task';
   import { listAllUserBind } from '@/api/system/organization';
 
   // 流程实例的详情页,可用于审批
@@ -172,8 +172,9 @@
             cancelButtonText: '取消',
             confirmButtonText: '确定'
           }).then(() => {
-            cancel({
-              id: this.taskId,
+            cancelTask({
+              id: this.id,
+              taskId: this.taskId,
               reason: this.form.reason,
               businessId: this.businessId,
             }).then(() => {

+ 4 - 3
src/views/bpm/handleTask/components/purchaseNeedManage/submit.vue

@@ -50,7 +50,7 @@
 
 <script>
   import { UpdateInformation, cancel } from '@/api/bpm/components/purchasingManage/purchaseNeedManage';
-  import {approveTaskWithVariables, rejectTask} from '@/api/bpm/task';
+  import {approveTaskWithVariables, rejectTask,cancelTask} from '@/api/bpm/task';
 
   // 流程实例的详情页,可用于审批
   export default {
@@ -139,8 +139,9 @@
             cancelButtonText: '取消',
             confirmButtonText: '确定'
           }).then(() => {
-            cancel({
-              id: this.taskId,
+            cancelTask({
+              taskId: this.taskId,
+              id: this.id,
               reason: this.form.reason,
               businessId: this.businessId,
             }).then(() => {