Browse Source

返工提审。

jxq 1 tháng trước cách đây
mục cha
commit
4bf8b86634

+ 2 - 2
.env.development

@@ -11,9 +11,9 @@ VITE_APP_BASE_API = '/dev-api'
 VITE_APP_UPLOAD_URL = 'http://139.155.176.112:19000'
 
 # 开发接口地址
-VITE_APP_API_URL = 'http://192.168.0.26:7104'
+VITE_APP_API_URL = 'http://192.168.1.69:7103'
 # Websocket地址
-VITE_WEBSOCKET_URL = 'ws://192.168.1.112:7103'
+VITE_WEBSOCKET_URL = 'ws://http://192.168.1.69:7103'
 ``
 # 是否启用 Mock 服务
 VITE_MOCK_DEV_SERVER = false

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

@@ -32,3 +32,19 @@ export function getunProcessedList(processId: string) {
   });
 }
 
+// 流程定义列表查询
+export function queryFlowDataList(queryParams: object) {
+  return request({
+    url: "/api/v1/definition/list",
+    method: "post",
+    data: queryParams,
+  });
+}
+
+// 下一节点人员 type 1 流程 2 任务
+export function getNextUser(type: string, id: string) {
+  return request({
+    url: `/api/v1/flowTask/nextUsers/${type}/${id}`,
+    method: "get",
+  });
+}

+ 10 - 0
src/api/rework/index.ts

@@ -19,6 +19,16 @@ export function addRework(data: any) {
     data,
   });
 }
+
+// 提交流程
+export function submitFlow(data: object) {
+  return request({
+    url: `/api/v1/flowTask/startFlow`,
+    method: "post",
+    data: data,
+  });
+}
+
 export function addRework1(data: any) {
   return request({
     url: "/api/v1/error/add",

+ 23 - 23
src/components/RealTimeMsg/index.vue

@@ -38,30 +38,30 @@
     </div>
     <!-- 静电环状态样式 -->
 
-    <div class="lightsBox">
-      <div>
-        <div class="titleText">电烙铁状态:</div>
-      </div>
-      <div :class="{ activeLight0: lightIndex == 0 }" class="light"></div>
-      <div :class="{ activeLight1: lightIndex == 1 }" class="light"></div>
-      <div :class="{ activeLight2: lightIndex == 2 }" class="light"></div>
-    </div>
-  </div>
-  <div class="staticBox">
-    <div :class="braceletState == 0 ? 'static type0' : 'static type1'">
-      <div class="titleText">静电手环状态:</div>
-      <div class="titleText state">
-        {{ braceletState == 0 ? "离线" : "在线" }}
-      </div>
-    </div>
-    <!-- <el-button
-        v-if="braceletState == 0"
-        type="primary"
-        class="staticBtn"
-        @click="submit(item, index)"
-        >重新检测</el-button
-      > -->
+    <!--    <div class="lightsBox">-->
+    <!--      <div>-->
+    <!--        <div class="titleText">电烙铁状态:</div>-->
+    <!--      </div>-->
+    <!--      <div :class="{ activeLight0: lightIndex == 0 }" class="light"></div>-->
+    <!--      <div :class="{ activeLight1: lightIndex == 1 }" class="light"></div>-->
+    <!--      <div :class="{ activeLight2: lightIndex == 2 }" class="light"></div>-->
+    <!--    </div>-->
   </div>
+  <!--  <div class="staticBox">-->
+  <!--    <div :class="braceletState == 0 ? 'static type0' : 'static type1'">-->
+  <!--      <div class="titleText">静电手环状态:</div>-->
+  <!--      <div class="titleText state">-->
+  <!--        {{ braceletState == 0 ? "离线" : "在线" }}-->
+  <!--      </div>-->
+  <!--    </div>-->
+  <!--    &lt;!&ndash; <el-button-->
+  <!--        v-if="braceletState == 0"-->
+  <!--        type="primary"-->
+  <!--        class="staticBtn"-->
+  <!--        @click="submit(item, index)"-->
+  <!--        >重新检测</el-button-->
+  <!--      > &ndash;&gt;-->
+  <!--  </div>-->
 </template>
 
 <script setup>

+ 9 - 9
src/layout/components/header.vue

@@ -49,15 +49,15 @@
           trigger="contextmenu"
           @command="handleCommand"
         >
-          <img
-            v-if="userStore.user.avatar"
-            :alt="userStore.user.avatar"
-            :src="userStore.user.avatar"
-            object-fit="cover"
-            style="width: 48px; height: 48px; border-radius: 24px"
-            @click="showClick"
-          />
-          <svg-icon v-else icon-class="head" size="48" @click="showClick" />
+          <!--          <img-->
+          <!--            v-if="userStore.user.avatar"-->
+          <!--            :alt="userStore.user.avatar"-->
+          <!--            :src="userStore.user.avatar"-->
+          <!--            object-fit="cover"-->
+          <!--            style="width: 48px; height: 48px; border-radius: 24px"-->
+          <!--            @click="showClick"-->
+          <!--          />-->
+          <svg-icon icon-class="head" size="48" @click="showClick" />
           <template #dropdown>
             <el-dropdown-menu style="width: 150px">
               <!--              <el-dropdown-item command="a">Action 1</el-dropdown-item>-->

+ 64 - 10
src/views/pro-operation/rework/index.vue

@@ -120,6 +120,26 @@
               <el-input v-model="ruleForm.remark" />
             </el-form-item>
           </el-form>
+
+          <el-form ref="flowFormRef" v-model="flowForm" label-width="100px">
+            <el-form-item label="选择流程模板">
+              <el-tree-select
+                v-model="flowForm.definitionId"
+                :data="flowDataList"
+                filterable
+                :props="{ label: 'flowName', value: 'id' }"
+                @change="whenSelectFlow"
+              />
+            </el-form-item>
+            <el-form-item :label="name" v-if="name">
+              <el-tree-select
+                v-model="flowForm.users"
+                :data="nextUserList"
+                filterable
+                :props="{ label: 'userName', value: 'userName' }"
+              />
+            </el-form-item>
+          </el-form>
         </el-scrollbar>
         <div class="btns">
           <el-button type="primary" @click="submit">提交</el-button>
@@ -129,7 +149,7 @@
   </div>
 </template>
 
-<script setup>
+<script setup lang="ts">
 import {
   breakReportInfoById,
   operationListByIds,
@@ -141,10 +161,15 @@ import {
   getList1,
   delError,
   getReworkList,
+  submitFlow,
 } from "@/api/rework";
 import { useProcessStore } from "@/store/modules/processView";
 import { useDictionaryStore } from "@/store/modules/dictionary";
-import {getunProcessedList} from "@/api/prosteps/index.js";
+import {
+  getNextUser,
+  getunProcessedList,
+  queryFlowDataList,
+} from "@/api/prosteps/index.js";
 const dictStroe = useDictionaryStore();
 const processStore = useProcessStore();
 const infoIndex = ref(null);
@@ -174,7 +199,7 @@ const getReworkTempList = async () => {
 };
 const tableData = ref([]);
 
-const processList=ref([]);
+const processList = ref([]);
 const toAdd = () => {
   formStatus.value = false;
   /*breakReportInfoById(processStore.scanInfo.id).then((res) => {
@@ -183,6 +208,7 @@ const toAdd = () => {
   getunProcessedList(processStore.scanInfo.id).then((res) => {
     processList.value = res.data ?? [];
   });
+  getFlowList();
 };
 const toList = () => {
   resetForm();
@@ -231,7 +257,7 @@ const submit = async () => {
 };
 
 const addTask = async () => {
-  const { code } = await addRework({
+  const res1 = await addRework({
     ...ruleForm.value,
     materialCode: processStore.scanInfo.materialCode,
     materialName: processStore.scanInfo.materialName,
@@ -241,12 +267,15 @@ const addTask = async () => {
     workOrderCode: processStore.odersData.workOrderCode,
     materialModel: processStore.processInfo.materialModel,
   });
-  if (code == "200") {
-    resetForm();
-    formStatus.value = true;
-    getPagination();
-    ElMessage.success("操作成功!");
-  }
+  let result = await submitFlow({
+    businessId: res1.data.id,
+    ...flowForm,
+  });
+
+  resetForm();
+  formStatus.value = true;
+  getPagination();
+  ElMessage.success("操作成功!");
 };
 
 const ruleFormRef = ref(null);
@@ -281,6 +310,31 @@ onMounted(() => {
   getPagination();
   getReworkTempList();
 });
+
+// 流程定义的列表
+const flowDataList = ref<any[]>([]);
+const getFlowList = () => {
+  queryFlowDataList({ flowType: flowForm.flow_type }).then((res) => {
+    flowDataList.value = res.data;
+  });
+};
+const name = ref("");
+const nextUserList = ref<any[]>([]);
+const whenSelectFlow = () => {
+  //   选择完模板之后  下一节点人员 type 1 流程 2 任务
+  getNextUser("1", flowForm.definitionId).then((res) => {
+    name.value = res.data?.roleName ?? "";
+    nextUserList.value = res.data?.users ?? [];
+  });
+};
+
+const flowFormRef = ref();
+const flowForm = reactive<any>({
+  flow_type: "reworkService",
+  definitionId: "",
+  users: "",
+  flowIns: "",
+});
 </script>
 
 <style lang="scss" scoped>