Jelajahi Sumber

收入分析

2545307760@qq.com 6 bulan lalu
induk
melakukan
d8535fa4b1

+ 9 - 0
web/src/api/approver.js

@@ -40,3 +40,12 @@ export const deleteApprovePerson = (data) => {
     data
   })
 }
+
+// 审批
+export const processApproval = (data) => {
+  return service({
+    url: '/description/processOperate',
+    method: 'POST',
+    data
+  })
+}

+ 25 - 0
web/src/api/notice.js

@@ -0,0 +1,25 @@
+import service from '@/utils/request'
+
+// 查询用户未读通知
+export const getUserUnreadNotice = (id) => {
+  return service({
+    url: '/notice/queryUserUnreadNotice?id=' + id,
+    method: 'get'
+  })
+}
+
+// 查询所有通知
+export const getAllNotices = () => {
+  return service({
+    url: '/notice/queryAllNotices',
+    method: 'get'
+  })
+}
+
+// 查询所有通知
+export const getReadNotice = (id) => {
+  return service({
+    url: '/notice/readNotice?id=' + id,
+    method: 'get'
+  })
+}

+ 32 - 2
web/src/view/approve/approveDetail/approveDetail.vue

@@ -107,6 +107,7 @@
             >
               <el-button
                 icon="Right"
+                @click="passThrough"
               >审核通过</el-button>
             </el-col>
           </el-row>
@@ -162,7 +163,9 @@ defineOptions({
 import { onMounted, reactive, ref } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import { getProjectProcessId } from '@/api/process'
+import { processApproval } from '@/api/approver'
 import { queryFileList } from '@/api/file'
+import { ElMessageBox } from 'element-plus'
 import sign from '@/assets/sign.png'
 const route = useRoute()
 const router = useRouter()
@@ -210,7 +213,7 @@ const queryProjectProcessById = () => {
       fileCondition.code = comprehensive.code
       queryFileList(fileCondition).then(res => {
         if (res.code === 0) {
-          console.log(res.data.list)
+          // console.log(res.data.list)
           fileList.length = 0
           fileList.push(...res.data.list)
         }
@@ -228,7 +231,19 @@ const repulseShow = ref(false)
 const openRepulse = () => {
   repulseShow.value = true
 }
-const repulseApply = () => {}
+// 审核数据
+const approvalData = reactive({
+  projectProcess: {},
+  description: {}
+})
+// 确认打回
+const repulseApply = () => {
+  processApproval(approvalData).then(res => {
+    if (res.code === 0) {
+      console.log(res.data)
+    }
+  })
+}
 // 补充文件
 const supplyFile = () => {
   router.push({ path: '/layout/projectManage/projectDetails', query: { code: comprehensive.code }})
@@ -236,6 +251,21 @@ const supplyFile = () => {
 
 // 详情类型
 const detailType = route.query.type
+
+const passThrough = () => {
+  ElMessageBox.confirm(
+    '确认审批通过吗?',
+    '确认',
+    {
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      type: 'warning',
+    }
+  )
+    .then(() => {})
+    .catch(() => {})
+}
+
 </script>
 
 <style scoped>

+ 74 - 2
web/src/view/layout/search/search.vue

@@ -1,5 +1,20 @@
 <template>
   <div class="search-component">
+    <div
+      class="message"
+      @click="openUnreadDialog"
+    >
+      <el-icon
+        style="margin:1px 0 0 0"
+        :size="16"
+      >
+        <Bell />
+      </el-icon>
+      <el-badge
+        :value="0"
+        class="custom-badge"
+      />
+    </div>
     <div
       class="gvaIcon gvaIcon-refresh"
       :class="[reload ? 'reloading' : '']"
@@ -10,18 +25,53 @@
       class="gvaIcon gvaIcon-customer-service"
       @click="toService"
     />
+    <el-dialog
+      v-model="unreadShow"
+      title="未读消息通知"
+    >
+      <el-row style="height: 400px">
+        <el-col :span="24">
+          <el-table
+            :data="unreadList"
+            stripe
+            height="400"
+          >
+            <el-table-column
+              label="消息标题"
+              prop="title"
+              width="180"
+            />
+            <el-table-column label="消息内容">
+              <template #default="scope">
+                <el-input
+                  v-model="scope.row.content"
+                  type="textarea"
+                  :rows="2"
+                  placeholder="消息内容"
+                  disabled
+                />
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-col>
+      </el-row>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
 import Screenfull from '@/view/layout/screenfull/index.vue'
 import { emitter } from '@/utils/bus.js'
-import { ref } from 'vue'
+import { ref, onMounted, reactive } from 'vue'
+import { useUserStore } from '@/pinia/modules/user'
+import { getUserUnreadNotice } from '@/api/notice'
 
 defineOptions({
   name: 'BtnBox',
 })
-
+onMounted(() => {
+  checkMessage()
+})
 const reload = ref(false)
 const handleReload = () => {
   reload.value = true
@@ -34,6 +84,25 @@ const toService = () => {
   window.open('https://support.qq.com/product/371961')
 }
 
+const use = useUserStore()
+
+const userId = use.userInfo.ID
+
+const unreadList = reactive([])
+
+const unreadShow = ref(false)
+const checkMessage = () => {
+  getUserUnreadNotice(userId).then(res => {
+    if (res.code === 0) {
+      console.log(res.data)
+      unreadList.length = 0
+      unreadList.push(...res.data)
+    }
+  })
+}
+const openUnreadDialog = () => {
+  unreadShow.value = true
+}
 </script>
 <style scoped lang="scss">
 
@@ -80,4 +149,7 @@ const toService = () => {
   }
 }
 
+.message{
+  height: 25px;
+}
 </style>