qinhb hace 2 meses
padre
commit
b390fee4d2

+ 1 - 1
src/api/flow/index.ts

@@ -74,7 +74,7 @@ export function getNextUser(type: string, id: string) {
 }
 
 // 提交流程
-export function submitFlow(data: object) {
+export function submitRouteFlow(data: object) {
   return request({
     url: `/api/v1/op/route/startFlow`,
     method: "post",

+ 5 - 4
src/components/WorkFlows/workFlowCheck.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { getNextUser, queryFlowDataList, submitFlow } from "@/api/flow";
+import { getNextUser, queryFlowDataList } from "@/api/flow";
 
 const dialogVisible = ref(false);
 const dialogTitle = ref("流程模板选择");
@@ -37,11 +37,12 @@ const close = () => {
 };
 
 const sureToSave = () => {
-  submitFlow(flowForm).then(() => {
+  emits("sureToSave",flowForm);
+  /*submitFlow(flowForm).then(() => {
     ElMessage.success("提交成功");
-    emits("sureToSave");
+    emits("sureToSave",flowForm);
     dialogVisible.value = false;
-  });
+  });*/
 };
 
 // businessId	业务ID   流程类型flow_type  测试类型  testService;   通用工艺提审  commonRouteFlowService;

+ 7 - 3
src/views/base/craftManagement/route/index.vue

@@ -292,7 +292,7 @@ import RouteChangeLog from "@/views/base/craftManagement/route/components/routeC
 import { ElMessageBox } from "element-plus";
 import WorkFlowCheck from "@/components/WorkFlows/workFlowCheck.vue";
 import LookFlowStep from "@/views/flow/common/LookFlowStep.vue";
-import { cancelFlow } from "@/api/flow";
+import { cancelFlow,submitRouteFlow } from "@/api/flow";
 const isLoading = ref(false);
 const loading = ref(false);
 // 数据字典相关
@@ -507,8 +507,12 @@ const onCancelFlow = (row) => {
     dataList();
   });
 };
-const onWFSave = () => {
-  dataList();
+const onWFSave = (flowForm) => {
+  submitRouteFlow(flowForm).then(() => {
+    ElMessage.success("提交成功");
+    workFlowCheckRef.value && workFlowCheckRef.value.close();
+    dataList();
+  });
 };
 //  工作流相关 end
 

+ 10 - 6
src/views/base/craftManagement/routeCommon/index.vue

@@ -167,7 +167,7 @@ import { getUserTree } from "@/api/system/user/index";
 import RouteChangeLog from "@/views/base/craftManagement/route/components/routeChangeLog.vue";
 import WorkFlowCheck from "@/components/WorkFlows/workFlowCheck.vue";
 import LookFlowStep from "@/views/flow/common/LookFlowStep.vue";
-import { cancelFlow } from "@/api/flow";
+import { cancelFlow,submitRouteFlow } from "@/api/flow";
 
 // 数据字典相关
 const { dicts } = useDictionaryStore();
@@ -461,19 +461,22 @@ option.value = Object.assign(option.value, {
   ],
 });
 
-//  工作流相关
+//  工作流相关 start
 const workFlowCheckRef = ref(null);
 const openCheckView = (row) => {
   row.businessId = row.id
-  workFlowCheckRef.value &&
-  workFlowCheckRef.value.openDialog(row, "routeFlowComService");
+  workFlowCheckRef.value && workFlowCheckRef.value.openDialog(row, "routeFlowComService");
 };
 const LookFlowStepRef = ref(null);
 const showFlowSteps = (row) => {
   LookFlowStepRef.value && LookFlowStepRef.value.openFlowStepDrawer(row.flowIns);
 };
-const onWFSave = () => {
-  dataList();
+const onWFSave = (flowForm) => {
+  submitRouteFlow(flowForm).then(() => {
+    ElMessage.success("提交成功");
+    workFlowCheckRef.value && workFlowCheckRef.value.close();
+    dataList();
+  });
 };
 
 const onCancelFlow = (row) => {
@@ -486,4 +489,5 @@ const onCancelFlow = (row) => {
     dataList();
   });
 };
+//工作流 end
 </script>

+ 12 - 3
src/views/flow/definition/index.vue

@@ -87,12 +87,21 @@ option.value = Object.assign(option.value, {
     {
       label: "流程版本",
       prop: "flowVersion",
+      hide: true,
+      type: 'number',
+      value: 1.0,
+      precision: 1,
+    },
+    {
+      label: "流程版本",
       html: true,
+      addDisplay: false,
+      editDisplay: false,
       formatter: (val) => {
         return (
-          '<b class="el-tag el-tag--success el-tag--light">V' +
-          val.flowVersion +
-          "</b>"
+            '<b class="el-tag el-tag--success el-tag--light">V' +
+            val.flowVersion +
+            "</b>"
         );
       },
     },

+ 48 - 6
src/views/plan/finishProduct/components/detail-stock.vue

@@ -15,6 +15,16 @@
       @selection-change="selectionChange"
     >
       <template #menu="{ row }">
+        <el-button link icon="el-icon-copy-document"
+            v-if="row.flowState == '0' || row.flowState == '2' || row.flowState == '-1'"
+            @click="openCheckView(row)">提审</el-button>
+
+        <el-button link v-if="row.flowState !== '0'" icon="el-icon-copy-document" @click="showFlowSteps(row)"
+        >流程</el-button>
+
+        <el-button link icon="el-icon-copy-document"
+            v-if="row.flowState == '3'"
+            @click="onCancelFlow(row)" >撤销</el-button>
         <el-button
             link
             v-if="row.flowState === '0' || row.flowState == '2' || row.flowState == '-1'"
@@ -22,22 +32,54 @@
             icon="el-icon-delete"
             @click="deleteRow(row)"
         >删除</el-button>
+
       </template>
     </avue-crud>
+    <LookFlowStep ref="LookFlowStepRef"></LookFlowStep>
+    <work-flow-check
+        ref="workFlowCheckRef"
+        @sureToSave="onWFSave"
+    ></work-flow-check>
   </div>
 </template>
 <script setup lang="ts">
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
-import ButtonPermKeys from "@/common/configs/buttonPermission";
 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";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
-// 数据字典相关
 
-const test = () => {
-  isShowTable.value = true;
-  tableType.value = tableType.value == 1 ? 2 : 1;
+//  工作流相关 start
+const workFlowCheckRef = ref(null);
+const openCheckView = (row) => {
+  row.businessId = row.id
+  workFlowCheckRef.value &&
+  workFlowCheckRef.value.openDialog(row, "seqInFlowService");
+};
+const LookFlowStepRef = ref(null);
+const showFlowSteps = (row) => {
+  LookFlowStepRef.value && LookFlowStepRef.value.openFlowStepDrawer(row.flowIns);
+};
+const onWFSave = () => {
+
+  dataNoPageList();
+};
+
+const onCancelFlow = (row) => {
+  console.log(row);
+  cancelFlow({
+    businessId: row.id,
+    flowIns: row.flowIns,
+  }).then(() => {
+    ElMessage.success("撤销成功");
+    dataNoPageList();
+  });
 };
+//工作流 end
+
+
 const props = defineProps({
   workOrderCode: {
     type: String,
@@ -106,7 +148,7 @@ option.value = Object.assign(option.value, {
     {
       label: "管号",
       prop: "seqNo",
-      minWidth: 250,
+      minWidth: 180,
       overHidden: true,
     },
     {

+ 1 - 1
src/views/plan/finishProduct/index.vue

@@ -31,7 +31,7 @@
     <el-dialog
       v-model="dialog.visible"
       :title="dialog.title"
-      width="90%"
+      width="85%"
       :destroy-on-close="true"
       @close="dialog.visible = false"
     >