2545307760@qq.com преди 1 година
родител
ревизия
2a9bf1fe5f

+ 28 - 4
web/src/api/process.js

@@ -53,8 +53,8 @@ export const switchProcess = (data) => {
   })
 }
 
-// 查询项目审批列表
-export const getItemApproveList = (data) => {
+// 查询发起人申请列表
+export const getApplyList = (data) => {
   return service({
     url: '/projectProcess/queryProjectApplicantList',
     method: 'POST',
@@ -62,11 +62,35 @@ export const getItemApproveList = (data) => {
   })
 }
 
-// 查询项目流程列表
-export const getItemProcessList = (data) => {
+// 查询需要审批的列表
+export const getExamineList = (data) => {
   return service({
     url: '/projectProcess/queryProjectProcessList',
     method: 'POST',
     data
   })
 }
+
+// 按id查询项目流程
+export const getIdProjectProcess = (id) => {
+  return service({
+    url: '/projectProcess/queryProjectProcessById?id=' + id,
+    method: 'GET'
+  })
+}
+
+// 按项目进程 ID 查询描述
+export const getProcessIdDescribe = (id) => {
+  return service({
+    url: '/description/queryDescriptionByProjectProcessId?projectProcessId=' + id,
+    method: 'GET'
+  })
+}
+
+// 按id查询流程细节
+export const getIdMinutia = (id) => {
+  return service({
+    url: '/description/queryDescriptionById?descriptionId=' + id,
+    method: 'GET'
+  })
+}

+ 29 - 0
web/src/view/approve/approveDetail/approveDetail.vue

@@ -0,0 +1,29 @@
+<template>
+  <div>
+    审批详情
+  </div>
+</template>
+
+<script setup>
+defineOptions({
+  name: 'ApproveDetail'
+})
+import { onMounted } from 'vue'
+import { useRoute } from 'vue-router'
+import { getProcessIdDescribe } from '@/api/process'
+const route = useRoute()
+onMounted(() => {
+  queryProcessIdDescribe()
+})
+const queryProcessIdDescribe = () => {
+  getProcessIdDescribe(route.query.id).then(res => {
+    if (res.code === 0) {
+      console.log(res)
+    }
+  })
+}
+</script>
+
+<style scoped>
+
+</style>

+ 23 - 119
web/src/view/approve/approveList/approveList.vue

@@ -1,134 +1,38 @@
 <template>
-  <div>
-    <div class="box">
-      <el-row>
-        <el-col :span="4">
-          <el-form>
-            <el-form-item label="审批发起人:">
-              <el-select
-                v-model="peopleSelect"
-                placeholder="请选择人员名称"
-                clearable
-                filterable
-                @change="changePeopleSelect"
-                @clear="clearPeopleSelect"
-              >
-                <el-option
-                  v-for="item in userList"
-                  :key="item.ID"
-                  :label="item.nickName"
-                  :value="item.ID"
-                />
-              </el-select>
-            </el-form-item>
-          </el-form>
-        </el-col>
-      </el-row>
-      <el-row style="margin-top: 10px">
-        <el-col :span="24">
-          <el-table :data="itemApproveList">
-            <el-table-column
-              label="项目流程名称"
-              align="center"
-              prop="projectProcessName"
-            />
-            <el-table-column
-              label="流程名称"
-              align="center"
-              prop="process.processName"
-            />
-            <el-table-column
-              label="流程类型"
-              align="center"
-              prop="process.processType"
-            />
-            <el-table-column
-              label="当前流程节点"
-              align="center"
-              prop="node.nodeName"
-            />
-            <el-table-column
-              label="操作"
-              align="center"
-            >
-              <template>
-                <el-button
-                  type="primary"
-                  icon="Memo"
-                  text
-                >详情</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-col>
-      </el-row>
-    </div>
+  <div class="box">
+    <el-tabs
+      v-model="activeName"
+      class="demo-tabs"
+    >
+      <el-tab-pane
+        label="申请列表"
+        name="Application"
+      >
+        <PromoterList />
+      </el-tab-pane>
+      <el-tab-pane
+        label="审批列表"
+        name="examine"
+      >
+        <InspectList />
+      </el-tab-pane>
+    </el-tabs>
   </div>
 </template>
 
 <script setup>
-import { onMounted, reactive, ref } from 'vue'
-import { getItemApproveList } from '@/api/process'
-import { getAllUsers } from '@/api/user'
-// import { ElMessage, ElMessageBox } from 'element-plus'
-
+import { ref } from 'vue'
+import PromoterList from './components/promoterList.vue'
+import InspectList from './components/inspectList.vue'
 defineOptions({
   name: 'ApproveList'
 })
-onMounted(() => {
-  queryItemApproveList()
-  getUserList()
-})
-
-// 查询项目审批列表
-const condition = reactive({
-  pageInfo: {
-    page: 1,
-    pageSize: 10,
-  },
-  userId: 0
-})
-const itemApproveList = reactive([])
-const queryItemApproveList = () => {
-  getItemApproveList(condition).then(res => {
-    if (res.code === 0) {
-      console.log(res.data.list)
-      const list = res.data.list
-      itemApproveList.length = 0
-      itemApproveList.push(...list)
-    }
-  })
-}
-
-// 查询用户列表
-const userList = reactive([])
-const peopleSelect = ref('')
-const getUserList = () => {
-  getAllUsers().then(res => {
-    if (res.code === 0) {
-      userList.length = 0
-      userList.push(...res.data)
-    }
-  })
-}
-const changePeopleSelect = (val) => {
-  userList.forEach(item => {
-    if (item.ID === val) {
-      peopleSelect.value = item.nickName
-      condition.userId = val
-      console.log(peopleSelect.value)
-    }
-  })
-}
-const clearPeopleSelect = () => {}
-
+const activeName = ref('Application')
 </script>
 
 <style scoped>
 .box{
-  width: 1550px;
-  height: 700px;
+  height: 760px;
   background-color: #ffffff;
-  padding: 20px;
 }
 </style>

+ 21 - 0
web/src/view/approve/approveList/components/inspectList.vue

@@ -1,5 +1,6 @@
 <template>
   <div>
+    审批列表
   </div>
 </template>
 
@@ -7,6 +8,26 @@
 defineOptions({
   name: 'InspectList'
 })
+import { onMounted } from 'vue'
+// import { getExamineList } from '@/api/process'
+onMounted(() => {
+  queryExamineList()
+})
+// const condition = reactive({
+//   pageInfo: {
+//     page: 1,
+//     pageSize: 10,
+//   },
+//   userId: 1
+// })
+const queryExamineList = () => {
+  // getExamineList(condition).then(res => {
+  //   console.log(res)
+  //   if (res.code === 0) {
+  //     console.log(res.data)
+  //   }
+  // })
+}
 </script>
 
 <style scoped>

+ 76 - 1
web/src/view/approve/approveList/components/promoterList.vue

@@ -1,11 +1,86 @@
 <template>
-
+  <div>
+    <el-row style="margin-top: 5px">
+      <el-col :span="24">
+        <el-table :data="itemApproveList">
+          <el-table-column
+            label="项目流程名称"
+            align="center"
+            prop="projectProcessName"
+          />
+          <el-table-column
+            label="流程名称"
+            align="center"
+            prop="process.processName"
+          />
+          <el-table-column
+            label="流程类型"
+            align="center"
+            prop="process.processType"
+          />
+          <el-table-column
+            label="当前流程节点"
+            align="center"
+            prop="node.nodeName"
+          />
+          <el-table-column
+            label="操作"
+            align="center"
+          >
+            <template #default="scope">
+              <el-button
+                type="primary"
+                icon="Memo"
+                text
+                @click="jumpApproveDetail(scope.row)"
+              >详情</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-col>
+    </el-row>
+  </div>
 </template>
 
 <script setup>
 defineOptions({
   name: 'PromoterList'
 })
+import { onMounted, reactive } from 'vue'
+import { getApplyList } from '@/api/process'
+import { useRouter } from 'vue-router'
+
+const router = useRouter()
+
+onMounted(() => {
+  queryApproveList()
+})
+
+// 查询项目审批列表
+const condition = reactive({
+  pageInfo: {
+    page: 1,
+    pageSize: 10,
+  },
+  userId: 0
+})
+const itemApproveList = reactive([])
+const queryApproveList = () => {
+  getApplyList(condition).then(res => {
+    if (res.code === 0) {
+      console.log(res.data.list)
+      const list = res.data.list
+      itemApproveList.length = 0
+      itemApproveList.push(...list)
+    }
+  })
+}
+
+// 跳转到详情页
+const jumpApproveDetail = (row) => {
+  // console.log(row.ID)
+  router.push({ path: '/layout/approve/approveDetail', query: { id: row.ID }})
+}
 </script>
 
 <style scoped>

+ 41 - 31
web/src/view/approve/flowManage/flowManage.vue

@@ -146,20 +146,33 @@
           style="margin-top: 20px"
           justify="end"
         >
-          <el-col :span="4">
+          <el-col
+            :span="4"
+            style="margin-right: 10px"
+          >
             <el-button
               type="primary"
               icon="Notebook"
               @click="openEffectDialog"
             >效果图</el-button>
           </el-col>
-          <el-col :span="4">
+          <el-col
+            :span="4"
+            style="margin-right: 20px"
+          >
             <el-button
               type="primary"
               icon="Plus"
               @click="openProcessNodeDialog()"
             >添加节点</el-button>
           </el-col>
+          <el-col :span="4">
+            <el-button
+              type="primary"
+              icon="Delete"
+              @click="deleteProcessNode()"
+            >删除节点</el-button>
+          </el-col>
         </el-row>
         <el-row style="margin-top: 20px">
           <el-col :span="24">
@@ -183,19 +196,6 @@
                 align="center"
                 prop="nodeHead"
               />
-              <el-table-column
-                label="操作"
-                align="center"
-              >
-                <template #default="scope">
-                  <el-button
-                    icon="Delete"
-                    type="primary"
-                    text
-                    @click="deleteProcessNode(scope.row)"
-                  >删除</el-button>
-                </template>
-              </el-table-column>
             </el-table>
           </el-col>
         </el-row>
@@ -234,16 +234,6 @@
               />
             </el-select>
           </el-form-item>
-          <el-form-item label="节点顺序:">
-            <el-select v-model="addProcessNodeData.nodeOrder">
-              <el-option
-                v-for="(item,index) in orderList"
-                :key="index"
-                :label="item"
-                :value="item"
-              />
-            </el-select>
-          </el-form-item>
         </el-form>
         <template #footer>
           <el-button
@@ -369,7 +359,6 @@ const openAddDrawer = () => {
 // 为流程添加、编辑节点
 const processNodeDialog = ref(false)
 const processNodeTitle = ref('新增流程节点')
-const orderList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
 const processType = [{ id: 1, value: '立项' }, { id: 2, value: '费用' }]
 const addProcessNodeData = reactive({
   nodeId: 0,
@@ -396,16 +385,37 @@ const changeNodeName = (val) => {
 const addProcessNodes = () => {
   const obj = {}
   Object.assign(obj, addProcessNodeData)
+  const list = intermediary.value
+  for (const i in list) {
+    if (list[i].nodeName === obj.nodeName) {
+      ElMessage.error('流程中存在相同的节点名称')
+      return
+    }
+  }
+  obj.nodeOrder = intermediary.value.length + 1
   intermediary.value.push(obj)
   processActive.value = intermediary.value.length
   processNodeDialog.value = false
 }
-const deleteProcessNode = (row) => {
-  intermediary.value.forEach((item, index) => {
-    if (row.nodeId === item.nodeId) {
-      intermediary.value.splice(index, 1)
+const deleteProcessNode = () => {
+  ElMessageBox.confirm(
+    '确定要删除节点吗?',
+    '删除流程',
+    {
+      confirmButtonText: '删除',
+      cancelButtonText: '取消',
+      type: 'warning',
     }
-  })
+  )
+    .then(() => {
+      intermediary.value = []
+    })
+    .catch(() => {
+      ElMessage({
+        type: 'info',
+        message: '取消删除',
+      })
+    })
 }
 
 // 编辑流程