Jelajahi Sumber

收入分析

2545307760@qq.com 6 bulan lalu
induk
melakukan
e57ef420fd

+ 1 - 1
web/src/api/notice.js

@@ -16,7 +16,7 @@ export const getAllNotices = () => {
   })
 }
 
-// 查询所有通知
+// 已读通知
 export const getReadNotice = (id) => {
   return service({
     url: '/notice/readNotice?id=' + id,

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

@@ -94,3 +94,12 @@ export const getIdMinutia = (id) => {
     method: 'GET'
   })
 }
+
+// 补充完毕
+export const supplyFinish = (id) => {
+  return service({
+    url: '/projectProcess/replenished?id=' + id,
+    method: 'GET'
+  })
+}
+

+ 2 - 3
web/src/main.js

@@ -15,7 +15,7 @@ import { store } from '@/pinia'
 import App from './App.vue'
 import { initDom } from './utils/positionToCode'
 import { DatePicker } from 'ant-design-vue'
-
+import moment from 'moment'
 initDom()
 /**
  * @description 导入加载进度条,防止首屏加载时间过长,用户等待
@@ -26,14 +26,13 @@ import 'nprogress/nprogress.css'
 import 'ant-design-vue/dist/reset.css'
 Nprogress.configure({ showSpinner: false, ease: 'ease', speed: 500 })
 Nprogress.start()
-
 /**
  * 无需在这块结束,会在路由中间件中结束此块内容
  * */
 
 const app = createApp(App)
 app.config.productionTip = false
-
+app.config.globalProperties.$moment = moment
 app
   .use(run)
   .use(store)

+ 121 - 35
web/src/view/approve/approveDetail/approveDetail.vue

@@ -62,17 +62,22 @@
           </el-row>
           <el-row style="margin-top: 20px">
             <el-col
-              :span="20"
+              :span="23"
             >
               <div class="collapseBox">
-                <el-collapse>
+                <el-collapse accordion>
                   <el-collapse-item
-                    v-for="item in comprehensive.descriptions"
+                    v-for="item in messageList"
                     :key="item.ID"
-                    :title="item.node.nodeName"
                     :name="item.ID"
                   >
-                    <div>
+                    <template #title>
+                      <el-text
+                        class="collapseBox-title"
+                        type="info"
+                      >{{ item.optionResult }}</el-text>
+                    </template>
+                    <div class="collapseBox-content">
                       {{ item.approvalOpinion }}
                     </div>
                   </el-collapse-item>
@@ -92,6 +97,16 @@
                 @click="supplyFile"
               >补充文件</el-button>
             </el-col>
+            <el-col
+              v-show="comprehensive.isBack"
+              :span="5"
+            >
+              <el-button
+                icon="Check"
+                type="primary"
+                @click="supplementFinish"
+              >补充完毕</el-button>
+            </el-col>
             <el-col
               v-show="detailType === 'inspect'"
               :span="5"
@@ -107,7 +122,7 @@
             >
               <el-button
                 icon="Right"
-                @click="passThrough"
+                @click="ratifyShow = true"
               >审核通过</el-button>
             </el-col>
           </el-row>
@@ -115,8 +130,6 @@
             style="margin-top: 30px"
             height="620px"
             :data="fileList"
-            border
-            stripe
           >
             <el-table-column
               label="ID"
@@ -139,6 +152,7 @@
       <el-form style="margin-top: 20px">
         <el-form-item>
           <el-input
+            v-model="returnContent"
             placeholder="请输入打回申请的理由以便申请人补充文件"
             type="textarea"
             :rows="5"
@@ -153,20 +167,44 @@
         >确认</el-button>
       </template>
     </el-dialog>
+    <el-dialog
+      v-model="ratifyShow"
+      title="通过申请"
+    >
+      <el-form style="margin-top: 20px">
+        <el-form-item>
+          <el-input
+            v-model="ratifyContent"
+            placeholder="请输入通过申请的留言(选填)"
+            type="textarea"
+            :rows="5"
+          />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button
+          type="primary"
+          size="large"
+          @click="passThrough"
+        >确认</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
+import moment from 'moment/moment'
+
 defineOptions({
   name: 'ApproveDetail'
 })
 import { onMounted, reactive, ref } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
-import { getProjectProcessId } from '@/api/process'
-import { processApproval } from '@/api/approver'
+import { getProjectProcessId, supplyFinish } from '@/api/process'
 import { queryFileList } from '@/api/file'
-import { ElMessageBox } from 'element-plus'
+import { ElMessage, ElMessageBox } from 'element-plus'
 import sign from '@/assets/sign.png'
+import { processApproval } from '@/api/approver'
 const route = useRoute()
 const router = useRouter()
 onMounted(() => {
@@ -184,6 +222,8 @@ const fileCondition = reactive({
 })
 // 项目流程信息
 const comprehensive = reactive({})
+// 消息数组
+const messageList = reactive([])
 // 节点数组
 const nodeList = reactive([])
 // 步骤进度
@@ -194,6 +234,20 @@ const applyPeople = ref('')
 const checkPeople = ref('')
 // 文件列表
 const fileList = reactive([])
+// 审核数据
+const approvalData = reactive({
+  projectProcess: {},
+  description: {
+    projectProcessId: 0,
+    approvalOpinion: '',
+    nodeId: 2,
+    approvalTime: '2024-09-23',
+    optionResult: '通过'
+  }
+})
+// 打回内容
+const returnContent = ref('')
+
 const queryProjectProcessById = () => {
   const id = route.query.id
   getProjectProcessId(id).then(res => {
@@ -201,16 +255,21 @@ const queryProjectProcessById = () => {
       const data = res.data
       nodeList.length = 0
       nodeList.push(...data.process.nodes)
-      nodeList.forEach(item => {
-        if (item.ID === data.node.ID) {
-          infoSteps.value = item.order - 1
-        }
-      })
+      infoSteps.value = data.node.order
       Object.assign(comprehensive, data)
+      console.log(data)
+      Object.assign(approvalData.projectProcess, data)
+      approvalData.description.projectProcessId = data.ID
+      approvalData.description.nodeId = data.node.ID
+      // 反转消息列表
+      messageList.length = 0
+      for (let index = data.descriptions.length - 1; index >= 0; index--) {
+        messageList.push(data.descriptions[index])
+      }
       // 申请人、审核人
       applyPeople.value = data.user.nickName
       checkPeople.value = data.node.approver.nickName
-      fileCondition.code = comprehensive.code
+      fileCondition.code = data.code
       queryFileList(fileCondition).then(res => {
         if (res.code === 0) {
           // console.log(res.data.list)
@@ -231,16 +290,21 @@ const repulseShow = ref(false)
 const openRepulse = () => {
   repulseShow.value = true
 }
-// 审核数据
-const approvalData = reactive({
-  projectProcess: {},
-  description: {}
-})
 // 确认打回
 const repulseApply = () => {
+  if (returnContent.value.length === 0) {
+    ElMessage.error('请输入打回申请的理由')
+  }
+  const date = moment()
+  approvalData.description.approvalOpinion = returnContent.value
+  approvalData.description.approvalTime = date.format('YYYY-MM-DD')
+  approvalData.description.optionResult = '打回'
   processApproval(approvalData).then(res => {
     if (res.code === 0) {
-      console.log(res.data)
+      ElMessage.success('打回成功')
+      queryProjectProcessById()
+      returnContent.value = ''
+      repulseShow.value = false
     }
   })
 }
@@ -251,24 +315,38 @@ const supplyFile = () => {
 
 // 详情类型
 const detailType = route.query.type
-
+// 审核通过
+const ratifyContent = ref('')
 const passThrough = () => {
-  ElMessageBox.confirm(
-    '确认审批通过吗?',
-    '确认',
-    {
-      confirmButtonText: '确定',
-      cancelButtonText: '取消',
-      type: 'warning',
+  const date = moment()
+  approvalData.description.approvalOpinion = ratifyContent.value
+  approvalData.description.approvalTime = date.format('YYYY-MM-DD')
+  approvalData.description.optionResult = '通过'
+  processApproval(approvalData).then(res => {
+    if (res.code === 0) {
+      ElMessage.success('审核完成')
+      queryProjectProcessById()
+      ratifyContent.value = ''
+      ratifyShow.value = false
+    }
+  })
+}
+
+// 补充完成
+const supplementFinish = () => {
+  supplyFinish(comprehensive.ID).then(res => {
+    if (res.code === 0) {
+      ElMessageBox.alert('申请已再次发送请等待审核结果', '提示', {
+        confirmButtonText: '确认'
+      })
     }
-  )
-    .then(() => {})
-    .catch(() => {})
+  })
 }
 
+const ratifyShow = ref(false)
 </script>
 
-<style scoped>
+<style scoped lang="scss">
 .basicInformation{
   height: 40px;
   background-color: #f8fafd;
@@ -280,6 +358,14 @@ const passThrough = () => {
   height: 400px;
   padding: 10px;
   overflow: scroll;
+  .collapseBox-title{
+    font-size: 16px;
+    font-weight: 550;
+  }
+  .collapseBox-content{
+    margin-top: 10px;
+    font-size: 16px;
+  }
 }
 
 .peopleInfo{

+ 57 - 30
web/src/view/layout/search/search.vue

@@ -11,8 +11,9 @@
         <Bell />
       </el-icon>
       <el-badge
-        :value="0"
+        :value="noticeNumber"
         class="custom-badge"
+        :show-zero="false"
       />
     </div>
     <div
@@ -25,37 +26,51 @@
       class="gvaIcon gvaIcon-customer-service"
       @click="toService"
     />
-    <el-dialog
+    <el-drawer
       v-model="unreadShow"
       title="未读消息通知"
+      size="45%"
     >
-      <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
+        :data="unreadList"
+        height="800"
+      >
+        <el-table-column
+          label="消息标题"
+          prop="title"
+          width="180"
+          align="center"
+        />
+        <el-table-column
+          label="消息内容"
+          align="center"
+        >
+          <template #default="scope">
+            <el-input
+              v-model="scope.row.content"
+              type="textarea"
+              :rows="2"
+              placeholder="消息内容"
+              disabled
             />
-            <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>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="操作"
+          align="center"
+          width="180"
+        >
+          <template #default="scope">
+            <el-button
+              icon="EditPen"
+              text
+              type="primary"
+              @click="markRead(scope.row)"
+            >标记为已读</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-drawer>
   </div>
 </template>
 
@@ -64,7 +79,8 @@ import Screenfull from '@/view/layout/screenfull/index.vue'
 import { emitter } from '@/utils/bus.js'
 import { ref, onMounted, reactive } from 'vue'
 import { useUserStore } from '@/pinia/modules/user'
-import { getUserUnreadNotice } from '@/api/notice'
+import { getUserUnreadNotice, getReadNotice } from '@/api/notice'
+import { ElMessage } from 'element-plus'
 
 defineOptions({
   name: 'BtnBox',
@@ -91,18 +107,29 @@ const userId = use.userInfo.ID
 const unreadList = reactive([])
 
 const unreadShow = ref(false)
+
+const noticeNumber = ref(0)
 const checkMessage = () => {
   getUserUnreadNotice(userId).then(res => {
     if (res.code === 0) {
-      console.log(res.data)
       unreadList.length = 0
       unreadList.push(...res.data)
+      noticeNumber.value = unreadList.length
     }
   })
 }
 const openUnreadDialog = () => {
   unreadShow.value = true
 }
+
+const markRead = (row) => {
+  getReadNotice(row.ID).then(res => {
+    if (res.code === 0) {
+      ElMessage.success('消息已阅读')
+      checkMessage()
+    }
+  })
+}
 </script>
 <style scoped lang="scss">