Kaynağa Gözat

审批流相关

yesheng 2 hafta önce
ebeveyn
işleme
fda9c517aa

+ 1 - 1
src/api/bpm/task.js

@@ -49,7 +49,7 @@ export function backTask(data) {
 
 export function updateTaskAssignee(data) {
   return request({
-    url: '/bpm/task/update-assignee',
+    url: '/bpm/task/transfer',
     method: 'PUT',
     data: data
   })

+ 38 - 12
src/views/wms/quality/iqcInspection/components/ApprovalTaskNew.vue

@@ -49,14 +49,14 @@
                 icon="el-icon-edit-outline"
                 type="success"
                 size="mini"
-                @click="handleAudit(item, 'Y')"
+                @click="handleAudit(item, 2)"
                 >通过</el-button
               >
               <el-button
                 icon="el-icon-circle-close"
                 type="danger"
                 size="mini"
-                @click="handleAudit(item, 'N')"
+                @click="handleAudit(item, 3)"
                 >不通过</el-button
               >
               <el-button
@@ -183,6 +183,15 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="转办原因" prop="reason">
+          <el-input
+            v-model="updateAssignee.form.reason"
+            type="textarea"
+            :rows="3"
+            clearable
+            placeholder="请输入转办理由"
+          />
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitUpdateAssigneeForm"
@@ -202,6 +211,7 @@ import { decodeFields } from "@/utils/formGenerator";
 import { getProcessInstance } from "@/api/bpm/processInstance";
 import {
   approveTask,
+  rejectTask,
   getTaskListByProcessInstanceId,
   updateTaskAssignee,
 } from "@/api/bpm/task";
@@ -258,11 +268,15 @@ export default {
         open: false,
         form: {
           assigneeUserId: undefined,
+          reason: undefined,
         },
         rules: {
           assigneeUserId: [
             { required: true, message: "新审批人不能为空", trigger: "change" },
           ],
+          reason: [
+            { required: true, message: "转办原因不能为空", trigger: "change" },
+          ],
         },
       },
 
@@ -404,7 +418,7 @@ export default {
             }
             this.runningTasks.push({ ...task });
             this.auditForms.push({
-              reason: "",
+              reason: "同意",
             });
           });
 
@@ -531,16 +545,28 @@ export default {
         const data = {
           id: task.id,
           reason: this.auditForms[index].reason,
-          argFlag: pass,
+          status: pass,
         };
-        approveTask(data).then((response) => {
-          const msg = data.argFlag === "Y" ? "通过" : "驳回";
-          this.$modal.msgSuccess("审批" + msg + "成功!");
-          this.getDetail(); // 获得最新详情
-          // 关闭当前窗口
-          this.$tab.closeOpenPage();
-          this.$router.go(-1);
-        });
+        //通过
+        if(pass === 2){
+          approveTask(data).then((response) => {
+            this.$modal.msgSuccess("审批通过成功!");
+            this.getDetail(); // 获得最新详情
+            // 关闭当前窗口
+            this.$tab.closeOpenPage();
+            this.$router.go(-1);
+          });
+        }
+        //不通过
+        else{
+          rejectTask(data).then((response) => {
+            this.$modal.msgSuccess("审批驳回成功!");
+            this.getDetail(); // 获得最新详情
+            // 关闭当前窗口
+            this.$tab.closeOpenPage();
+            this.$router.go(-1);
+          });
+        }
       });
     },
   },