Browse Source

流程完善

qinhb 3 weeks ago
parent
commit
05c17fe5e7

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

@@ -82,6 +82,14 @@ export function submitFlow(data: object) {
   });
 }
 
+export function audit(data: object) {
+  return request({
+    url: `/api/v1/flowTask/audit`,
+    method: "post",
+    data: data,
+  });
+}
+
 // 流程撤销
 export function cancelFlow(data: object) {
   return request({

+ 46 - 6
src/views/flow/common/CheckFlow.vue

@@ -3,7 +3,7 @@ import {
   getNextUser,
   queryFlowDataList,
   queryFlowRecord,
-  submitFlow,
+  audit,
 } from "@/api/flow";
 import {
   ComponentNameClass,
@@ -28,7 +28,16 @@ let currentRow: any = {};
 const openCheckDrawer = (row) => {
   dialogVisible.value = true;
   currentRow = row;
+  userList.value = []
+  getNextUser("2", row.id).then((res) => {
+     if(res.data){
+       showLabel.value = res.data.roleName
+       userList.value = res.data.users
+     }
+  });
 };
+const userList = ref([])
+const showLabel = ref(null)
 
 defineExpose({
   openCheckDrawer,
@@ -44,12 +53,20 @@ const allComponents = shallowReactive({
   RouteFlowComService,
 });
 
+const auditObj =(params) =>{
+  audit(params).then((res)=>{
+    emits("finish", 1);
+    dialogVisible.value = false;
+  })
+}
 const toPass = async () => {
-  dialogVisible.value = false;
+  const params = {taskId: currentRow.id,message: currentRow.message,state: 1,nextUsers: currentRow.nextUsers}
+  auditObj(params)
 };
 
 const disAgree = async () => {
-  dialogVisible.value = false;
+  const params = {taskId: currentRow.id,message: currentRow.message,state: -1,nextUsers: currentRow.nextUsers}
+  auditObj(params)
 };
 </script>
 
@@ -78,7 +95,7 @@ const disAgree = async () => {
                 :row="currentRow"
               />
             </el-collapse-item>
-            <el-collapse-item title="Feedback" name="2">
+<!--            <el-collapse-item title="Feedback" name="2">
               <div>
                 {{ componentName }}
               </div>
@@ -86,8 +103,31 @@ const disAgree = async () => {
                 Visual feedback: reflect current state by updating or
                 rearranging elements of the page.
               </div>
-            </el-collapse-item>
+            </el-collapse-item>-->
           </el-collapse>
+          <el-form>
+            <el-form-item :label="showLabel" v-if="showLabel && userList">
+              <el-select
+                  v-model="currentRow.nextUsers"
+                  filterable
+                  allow-create
+                  default-first-option
+                  placeholder="请选择人员"
+              >
+                <el-option
+                    v-if="userList"
+                    v-for="item in userList"
+                    :key="item.userName"
+                    :label="item.userName"
+                    :value="item.userName"
+                />
+              </el-select>
+            </el-form-item>
+
+            <el-form-item label="审核意见">
+              <el-input v-model="currentRow.message"></el-input>
+            </el-form-item>
+          </el-form>
         </div>
       </el-scrollbar>
     </template>
@@ -95,7 +135,7 @@ const disAgree = async () => {
       <div style="flex: auto">
         <el-button @click="close">取消</el-button>
         <el-button type="primary" @click="toPass">通过</el-button>
-        <el-button type="warning" @click="toPass">不同意</el-button>
+        <el-button type="warning" @click="disAgree">不同意</el-button>
       </div>
     </template>
   </el-drawer>

+ 9 - 1
src/views/flow/done/index.vue

@@ -95,7 +95,15 @@ option.value = Object.assign(option.value, {
         label: "dictLabel",
         value: "dictValue",
       },
-    }
+    },
+    {
+      label: "审核人员",
+      prop: "auditUser",
+    },
+    {
+      label: "审核时间",
+      prop: "auditTime",
+    },
   ],
 });
 

+ 1 - 1
src/views/flow/todo/index.vue

@@ -130,6 +130,6 @@ const showFlowDetail = (row) => {
   CheckFlowRef.value && CheckFlowRef.value.openCheckDrawer(row);
 };
 const onCheckFinish = (value) => {
-  console.log(value);
+  dataList();
 };
 </script>