ysy 1 год назад
Родитель
Сommit
bf7b942595

+ 10 - 0
src/api/bpm/components/bomApprover/index.js

@@ -10,3 +10,13 @@ export async function getBomPageCategoryId(params) {
 }
 
 
+// 不通过任务,关闭流程
+
+export async function notPass(data) {
+  const res = await request.put(`/bpm/bom/notPass`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 9 - 44
src/views/bpm/handleTask/components/bomApprover/submit.vue

@@ -17,12 +17,6 @@
       <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit(0)">驳回
       </el-button>
 
-      <el-dropdown @command="(command) => handleCommand(command)" style="margin-left: 30px;">
-        <span class="el-dropdown-link">更多<i class="el-icon-arrow-down el-icon--right"></i></span>
-        <el-dropdown-menu slot="dropdown">
-          <el-dropdown-item command="cancel">作废</el-dropdown-item>
-        </el-dropdown-menu>
-      </el-dropdown>
 
 
     </div>
@@ -32,9 +26,8 @@
 
 <script>
 
-import { apspurchaseplan, cancel } from '@/api/bpm/components/apsMeterialPlan';
 import { approveTaskWithVariables } from '@/api/bpm/task';
-import { listAllUserBind } from '@/api/system/organization';
+import { notPass } from '@/api/bpm/components/bomApprover';
 
 // 流程实例的详情页,可用于审批
 export default {
@@ -60,39 +53,30 @@ export default {
   data() {
     return {
       form: {
-        technicianId: '',
         reason: ''
       },
-      userOptions: []
+
     };
   },
   created() {
-    this.userOptions = [];
-    listAllUserBind().then((data) => {
-      this.userOptions.push(...data);
-    });
+
   },
   methods: {
 
 
-    async handleAudit(status, type) {
-      //生产主管审批选择技术员
-
+    async handleAudit(status) {
 
       this._approveTaskWithVariables(status);
     },
     async _approveTaskWithVariables(status) {
 
-
       if (status == 1) {
 
-        apspurchaseplan({
+        approveTaskWithVariables({
           businessId: this.businessId,
           id: this.taskId,
-          userId: this.form.technicianId,
-          userName: this.form.userName,
           reason: this.form.reason,
-          pass: true
+          variables: { pass: true }
 
         }).then((res) => {
           if (res.data.code != '-1') {
@@ -103,10 +87,10 @@ export default {
           }
         });
       } else if (status == 0) {
-        approveTaskWithVariables({
+        notPass({
+          businessId: this.businessId,
           id: this.taskId,
           reason: this.form.reason,
-          pass: false
         }).then((res) => {
           if (res.data.code != '-1') {
             this.$emit('handleAudit', {
@@ -127,26 +111,7 @@ export default {
       });
     },
 
-    //更多
-    handleCommand(command) {
-      if (command === 'cancel') {
-        this.$confirm("是否确认作废?", {
-          type: 'warning',
-          cancelButtonText: '取消',
-          confirmButtonText: '确定'
-        }).then(() => {
-          cancel({
-            id: this.taskId,
-            reason: this.form.reason,
-            businessId: this.businessId,
-          }).then(() => {
-            this.$emit('handleClose');
-          }).catch(() => {
-            this.$message.error("流程作废失败");
-          });
-        }).catch(() => {});
-      }
-    },
+
 
   }
 };