Przeglądaj źródła

feat:返工增加流程

lupeng 2 miesięcy temu
rodzic
commit
2dc63f7b60

+ 2 - 2
src/views/base/apply/index.vue

@@ -63,7 +63,7 @@ import { useCrud } from "@/hooks/userCrud";
 import { useCommonStoreHook, useDictionaryStore } from "@/store";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 import Apply from "./apply.vue";
-import {cancelFormDataFlow} from "@/api/flow";
+import {cancelFlow} from "@/api/flow";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 const activeName = ref("no");
 // 数据字典相关
@@ -93,7 +93,7 @@ const dialog = ref({
   title: "归档申请",
 });
 const onCancelFlow=(row)=>{
-    cancelFormDataFlow({
+    cancelFlow({
         businessId: row.id,
         flowIns: row.flowIns,
     }).then(() => {

+ 10 - 5
src/views/quality/rework/components/rework-detail.vue

@@ -20,7 +20,7 @@
         <el-button
           icon="el-icon-edit"
           text
-          v-if="props.status == 0 || props.status == 1"
+          v-if="(props.status == 0 || props.status == 1)&&props.flowState!=='1'&&props.flowState!=='3'"
           @click="doEdit(row, index)"
           type="primary"
           :size="size"
@@ -48,7 +48,7 @@ import dictDataUtil from "@/common/configs/dictDataUtil";
 import ButtonPermKeys from "@/common/configs/buttonPermission";
 import { useCommonStoreHook, useDictionaryStore } from "@/store";
 import SingleUpload from "@/components/Upload/SingleUpload.vue";
-import { getUserList } from "@/api/system/user";
+import {getUserList, getUserTree} from "@/api/system/user";
 import { ref } from "vue";
 import FilesUpload from "@/components/Upload/FilesUpload.vue";
 
@@ -74,6 +74,12 @@ const props = defineProps({
       return 0;
     },
   },
+  flowState: {
+    type: String,
+    default: () => {
+      return 0;
+    },
+  },
   dialog: {
     type: Object,
     default: () => {
@@ -102,7 +108,7 @@ const testFiles = () => {
 onMounted(() => {
   search.value.recordId = props.recordId;
   dataList();
-  getUserList({}).then((data) => {
+  getUserTree().then((data) => {
     userList.value = data.data;
   });
 });
@@ -161,10 +167,9 @@ option.value = Object.assign(option.value, {
     {
       label: "检验人",
       prop: "checkName",
-      type: "select",
+      type: "tree",
       dicData: userList,
       filterable: true,
-      props: { label: "userName", value: "userName" },
     },
     {
       label: "操作者",

+ 53 - 12
src/views/quality/rework/index.vue

@@ -29,7 +29,7 @@
           text
           @click="doEdit(row, index)"
           type="primary"
-          v-if="row.state === 0 || row.state === 1"
+          v-if="(row.state === 0 || row.state === 1)&&row.flowState!=='1'&&row.flowState!=='3'"
           :size="size"
           >编辑</el-button
         >
@@ -56,16 +56,8 @@
           v-if="row.state === 0"
           >确认返工</el-button
         >
-        <el-button
-          icon="el-icon-edit"
-          text
-          v-if="row.state === 1"
-          @click="handle(row, index, 3)"
-          type="primary"
-          :size="size"
-          >返工完成</el-button
-        >
-        <el-button
+
+<!--        <el-button
           icon="el-icon-edit"
           text
           v-if="row.state === 1"
@@ -73,7 +65,8 @@
           type="primary"
           :size="size"
         >返工完成</el-button
-        >
+        >-->
+
         <el-button
           @click="document(row)"
           icon="el-icon-document"
@@ -82,6 +75,24 @@
           type="primary"
         >领料单</el-button
         >
+
+        <el-button
+            link
+            icon="el-icon-copy-document"
+            v-if="row.state=='1'&&(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
+        >
       </template>
 
       <template #menu-right="{}">
@@ -118,10 +129,17 @@
         :dialog="dialog1"
         :orderCode="record.orderCode"
         :status="record.state"
+        :flowState="record.flowState"
       />
     </el-dialog>
     <ReworkShow v-model="showState" :tableData="tableData" />
+    <LookFlowStep ref="LookFlowStepRef"></LookFlowStep>
+    <WorkFlowCheck
+        ref="workFlowCheckRef"
+        @sureToSave="onWFSave"
+    ></WorkFlowCheck>
   </div>
+
 </template>
 <script setup>
 import { useCrud } from "@/hooks/userCrud";
@@ -134,6 +152,10 @@ import { handleReworkRecord, getReworkItem } from "@/api/fault/index";
 import ReworkShow from "@/views/quality/rework/components/rework-show.vue";
 
 import ReworkDocument from "@/views/quality/rework/components/rework-document.vue";
+import WorkFlowCheck from "@/components/WorkFlows/workFlowCheck.vue";
+import LookFlowStep from "@/views/flow/common/LookFlowStep.vue";
+
+import { cancelFlow,submitFlow } from "@/api/flow";
 
 // 数据字典相关
 const { dicts } = useDictionaryStore();
@@ -163,6 +185,25 @@ const doEdit = (row, index) => {
 onMounted(() => {
   dataList();
 });
+const workFlowCheckRef = ref(null);
+const openCheckView = (row) => {
+  row.businessId = row.id
+  workFlowCheckRef.value && workFlowCheckRef.value.openDialog(row, "reworkService");
+};
+
+const onWFSave = (flowForm) => {
+  submitFlow(flowForm).then(() => {
+    ElMessage.success("提交成功");
+    workFlowCheckRef.value && workFlowCheckRef.value.close();
+    dataList();
+  });
+};
+const onCancelFlow=(row)=>{
+  cancelFlow(row).then(() => {
+    ElMessage.success("提交成功");
+    dataList();
+  });
+}
 const record = ref({});
 const operation = (row) => {
   record.value = row;