Browse Source

添加成品入库流程

qinhb 2 months ago
parent
commit
a55d0318e7
2 changed files with 24 additions and 5 deletions
  1. 16 0
      src/api/flow/index.ts
  2. 8 5
      src/views/plan/finishProduct/components/detail-stock.vue

+ 16 - 0
src/api/flow/index.ts

@@ -72,6 +72,22 @@ export function getNextUser(type: string, id: string) {
     method: "get",
   });
 }
+// 提交流程
+export function submitSeqInFlow(data: object) {
+  return request({
+    url: `/api/v1/plan/seq/in/stock/startFlow`,
+    method: "post",
+    data: data,
+  });
+}
+// 流程撤销
+export function cancelSeqInFlow(data: object) {
+  return request({
+    url: `/api/v1/plan/seq/in/stock/cancelFlow`,
+    method: "post",
+    data: data,
+  });
+}
 
 // 提交流程
 export function submitRouteFlow(data: object) {

+ 8 - 5
src/views/plan/finishProduct/components/detail-stock.vue

@@ -48,7 +48,7 @@ import { useCrud } from "@/hooks/userCrud";
 import { useCommonStoreHook, useDictionaryStore } from "@/store";
 import WorkFlowCheck from "@/components/WorkFlows/workFlowCheck.vue";
 import LookFlowStep from "@/views/flow/common/LookFlowStep.vue";
-import { cancelFlow } from "@/api/flow";
+import { cancelSeqInFlow,submitSeqInFlow } from "@/api/flow";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 
 //  工作流相关 start
@@ -62,14 +62,17 @@ const LookFlowStepRef = ref(null);
 const showFlowSteps = (row) => {
   LookFlowStepRef.value && LookFlowStepRef.value.openFlowStepDrawer(row.flowIns);
 };
-const onWFSave = () => {
-
-  dataNoPageList();
+const onWFSave = (flowForm) => {
+  submitSeqInFlow(flowForm).then(() => {
+    ElMessage.success("提交成功");
+    workFlowCheckRef.value && workFlowCheckRef.value.close();
+    dataNoPageList();
+  });
 };
 
 const onCancelFlow = (row) => {
   console.log(row);
-  cancelFlow({
+  cancelSeqInFlow({
     businessId: row.id,
     flowIns: row.flowIns,
   }).then(() => {