Selaa lähdekoodia

Merge branch 'master' of http://1.71.9.215:3000/feiyi/cbjsxt-front-master

shiyanyu 1 kuukausi sitten
vanhempi
commit
c1184456de

+ 33 - 1
src/api/home.js

@@ -10,7 +10,14 @@ export function getList(params) {
     params,
   })
 }
-
+// 企业待办列表
+export function getEnterpriseList(data) {
+  return request({
+    url: `${url}/api/enterprise/reviewTask/pageListChild`,
+    method: 'post',
+    data,
+  })
+}
 export function getMsgList(params) {
   return request({
     url: `${url}/api/enterprise/home/doMsgList`,
@@ -18,6 +25,31 @@ export function getMsgList(params) {
     params,
   })
 }
+// 更多消息
+export function getNoticeList(data) {
+  return request({
+    url: `${url}/api/costNotice/v1/pageList`,
+    method: 'post',
+    data,
+  })
+}
+// 阅读通知公告表数据
+export function readNotice(params) {
+  return request({
+    url: `${url}/api/costNotice/v1/read`,
+    method: 'get',
+    params: params,
+  })
+}
+
+// 根据id获取通知公告表数据详情
+export function getNoticeDetail(params) {
+  return request({
+    url: `${url}/api/costNotice/v1/getDetail`,
+    method: 'get',
+    params: params,
+  })
+}
 
 export function getChartList(params) {
   return request({

+ 5 - 4
src/api/memoManage.js

@@ -1,10 +1,11 @@
 import request from '@/utils/request'
 const url = window.context.form
 
-// 备忘录列表
-export function getMemoList(params) {
+// 备忘录列表 /api/costProjectMemo/v1/pageList
+// 首页-备忘录列表 /api/costProjectMemo/v1/pageIndexList
+export function getMemoList(_url, params) {
   return request({
-    url: `${url}/api/costProjectMemo/v1/pageList`,
+    url: `${url}${_url}`,
     method: 'post',
     data: params,
   })
@@ -22,7 +23,7 @@ export function getMemoDetail(params) {
 // 添加备忘录
 export function addMemo(params) {
   return request({
-    url: `${url}/api/costProjectMemo/v1/`,
+    url: `${url}/api/costProjectMemo/v1/save`,
     method: 'post',
     data: params,
   })

+ 1 - 1
src/views/costAudit/projectInfo/auditProjectManage/memoManage/index.vue

@@ -371,7 +371,7 @@
     mounted() {
       this.$el.querySelector('div.el-calendar__header').remove()
       this.getAuditTaskList()
-      this.initCalendarData()
+      this.initCalendarData('memoManage')
     },
     methods: {},
   }

+ 25 - 9
src/views/costAudit/projectInfo/auditProjectManage/memoManage/memoManageMixin.js

@@ -75,6 +75,7 @@ export const memoManageMixin = {
     ]
 
     return {
+      type: 'index', // 列表类型:index-首页列表,memoManage-备忘录列表
       dictData: {
         reminderType: [],
       },
@@ -385,11 +386,23 @@ export const memoManageMixin = {
       try {
         let params = {
           ...this.searchParams,
-          pageSize: this.searchParams.pageSize,
+          // memoDate:''
         }
-        const res = await getMemoList(params)
-        if (res.rows && res.rows.length > 0) {
-          this.memoList = res.rows || []
+        let _url = ''
+        if (this.type === 'memoManage') {
+          _url = '/api/costProjectMemo/v1/pageList'
+        } else {
+          _url = '/api/costProjectMemo/v1/pageIndexList'
+        }
+        if (this.activeTab == 'project') {
+          delete params.memoDate
+        } else if (this.activeTab == 'calendar') {
+          params.memoDate = this.searchParams.memoDate
+          delete params.year
+        }
+        const res = await getMemoList(_url, params)
+        if (res.value && res.value.records.length > 0) {
+          this.memoList = res.value.records || []
           // 只处理day字段,不调用详情接口
           this.memoList.forEach((item) => {
             const date = new Date(item.memoDate)
@@ -397,7 +410,10 @@ export const memoManageMixin = {
           })
           // 在列表数据设置完成后,只调用一次详情接口获取所有需要的详情
           await this.getTasksByDateList()
-          this.listTotal = res.total || 0
+          this.listTotal = res.value.total || 0
+        } else {
+          this.memoList = []
+          this.listTotal = 0
         }
       } catch (error) {
         console.error('获取数据失败:', error)
@@ -430,7 +446,8 @@ export const memoManageMixin = {
       this.handleSearch()
     },
     // 初始化日历相关数据
-    initCalendarData(num) {
+    initCalendarData(type) {
+      this.type = type
       this.selectedDate = new Date()
       this.lunarInfo = this.getLunarInfo(this.selectedDate)
       // this.handleSearch(num)
@@ -443,9 +460,8 @@ export const memoManageMixin = {
       this.searchParams.content = ''
       this.searchParams.page = 1
       if (tab.name == 'calendar') {
-        ;(this.currentYear = new Date().getFullYear()),
-          (this.currentMonth = new Date().getMonth() + 1), // 月份从1开始
-          this.setCalendarTitle()
+        this.setCalendarTitle()
+        this.handleSearch()
       } else {
         this.handleSearch()
       }

+ 136 - 19
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/auditNoticeTab.vue

@@ -63,9 +63,7 @@
             <el-button
               type="text"
               size="mini"
-              @click="
-                handleViewScan(scope.row.scanDocumentUrl, 'scanDocumentUrl')
-              "
+              @click="handleViewScan(scope.row.scanDocumentUrl)"
             >
               查看附件
             </el-button>
@@ -82,12 +80,7 @@
             <el-button
               type="text"
               size="mini"
-              @click="
-                handleViewScan(
-                  scope.row.feedbackDocumentUrl,
-                  'feedbackDocumentUrl'
-                )
-              "
+              @click="handleViewScan(scope.row.feedbackDocumentUrl)"
             >
               查看附件
             </el-button>
@@ -268,10 +261,28 @@
                 >
                   <template slot-scope="scope">
                     <el-input
+                      v-if="scope.row.originalText !== '需要提供材料'"
                       v-model="scope.row.dataValue"
                       size="small"
                       placeholder="请输入数据值"
                     ></el-input>
+                    <!-- 否则显示上传按钮 -->
+                    <div v-else>
+                      <el-button
+                        type="primary"
+                        size="small"
+                        @click="handleUploadClick(scope.row)"
+                      >
+                        上传附件
+                      </el-button>
+                      <el-button
+                        type="primary"
+                        size="small"
+                        @click="handleViewScan(scope.row.dataValue)"
+                      >
+                        查看附件
+                      </el-button>
+                    </div>
                   </template>
                 </el-table-column>
               </el-table>
@@ -407,13 +418,13 @@
         selectDocumentWhSelection: [],
         costDocumentTemplateFiles: [],
         documentRules: {
-          documentNumber: [
-            {
-              required: true,
-              message: '请选择通知书文号',
-              trigger: 'change',
-            },
-          ],
+          // documentNumber: [
+          //   {
+          //     required: true,
+          //     message: '请选择通知书文号',
+          //     trigger: 'change',
+          //   },
+          // ],
           enterpriseId: [
             {
               required: true,
@@ -436,6 +447,7 @@
             },
           ],
         },
+        dataUploadUrl: [],
       }
     },
     computed: {
@@ -479,7 +491,38 @@
         ]
       },
     },
-    watch: {},
+    watch: {
+      costDocumentTemplateFiles: {
+        handler(newVal, oldVal) {
+          if (newVal.length > 0) {
+            console.log(this.costDocumentTemplateFiles)
+            this.costDocumentTemplateFiles.forEach((item) => {
+              if (
+                item.pinyin.includes('ShiJian') &&
+                (item.dataValue == null || item.dataValue == '')
+              ) {
+                // 获取当前时间,格式为YYYY-MM-DD HH:mm:ss
+                let date = new Date()
+                let year = date.getFullYear()
+                let month = String(date.getMonth() + 1).padStart(2, '0')
+                let day = String(date.getDate()).padStart(2, '0')
+                let hours = String(date.getHours()).padStart(2, '0')
+                let minutes = String(date.getMinutes()).padStart(2, '0')
+                let seconds = String(date.getSeconds()).padStart(2, '0')
+                item.dataValue = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+              }
+              if (
+                item.originalText.includes('需要提供材料') &&
+                item.dataValue
+              ) {
+                this.dataUploadUrl = item.dataValue
+              }
+            })
+          }
+        },
+        deep: true,
+      },
+    },
     mounted() {},
     methods: {
       handleDocumentTypeClick(data) {
@@ -560,6 +603,7 @@
         this.documentDialogTitle = '添加监审通知书'
         this.documentDialogVisible = true
         this.activeView = 'form'
+        this.costDocumentTemplateFiles = []
         this.document = {
           createBy: '',
           createTime: '',
@@ -596,7 +640,6 @@
           this.document.documentId = this.activeDocumentTypeId
           this.handleTemplateChange()
         }
-        this.costProjectDocumentFiles = []
       },
       getDetail() {
         getCostProjectDocumentDetail({
@@ -875,7 +918,7 @@
         input.click()
       },
       // 查看扫描件
-      handleViewScan(fileUrl, type) {
+      handleViewScan(fileUrl) {
         if (!fileUrl) {
           this.$message.error('暂无文件!')
           return
@@ -1048,6 +1091,80 @@
             console.error('获取文件URL失败:', error)
           })
       },
+      handleUploadClick(row) {
+        console.log('handleUploadClick', row)
+        let loading = null
+        // 第一步:创建文件选择器
+        const input = document.createElement('input')
+        input.type = 'file'
+        input.accept = '.pdf,.doc,.docx,.xls,.xlsx,.csv' // 允许的文件类型
+
+        input.onchange = async (event) => {
+          const file = event.target.files[0]
+          if (!file) return
+
+          try {
+            // 校验文件大小(50MB)
+            const maxSize = 50 * 1024 * 1024 // 50MB
+            if (file.size > maxSize) {
+              this.$message.error('文件大小不能超过50MB!')
+              return
+            }
+
+            // 校验文件格式
+            const allowedFormats = [
+              '.pdf',
+              '.doc',
+              '.docx',
+              '.xls',
+              '.xlsx',
+              'csv',
+            ]
+            const fileName = file.name.toLowerCase()
+            const isValidFormat = allowedFormats.some((format) =>
+              fileName.endsWith(format)
+            )
+
+            if (!isValidFormat) {
+              this.$message.error(
+                '只允许上传.pdf,.doc,.docx,.xls,.xlsx,.csv格式的文件!'
+              )
+              return
+            }
+
+            // 显示遮罩层
+            loading = this.$baseLoading(1, '文件上传中...')
+
+            // 第三步:创建FormData并上传文件
+            const formData = new FormData()
+            formData.append('file', file)
+
+            // 先调用上传API
+            const uploadRes = await uploadFile('/api/file/v1/upload', formData)
+
+            // 第四步:检查上传结果
+            if (!uploadRes || !uploadRes.value) {
+              // this.$message.error('文件上传失败!');
+              return
+            }
+
+            // 第五步:文件上传成功后,再更新数据
+            const fileInfo = uploadRes.value
+            this.costDocumentTemplateFiles.find(
+              (item) => item.originalText === row.originalText
+            ).dataValue = fileInfo.savePath
+            this.$message.success('文件上传成功!')
+          } catch (error) {
+            console.error('文件上传失败:', error)
+          } finally {
+            // 关闭遮罩层
+            loading.close()
+          }
+        }
+
+        // 触发文件选择对话框显示
+        input.click()
+      },
     },
   }
 </script>

+ 147 - 75
src/views/home/index.vue

@@ -114,11 +114,16 @@
               align="center"
             >
               <template slot-scope="scope">
-                <!-- 只显示父节点的序号 -->
-                <span v-if="scope.row.children">
-                  {{ getParentNodeIndex(scope.row) }}
+                <span v-if="curOrg == '企业单位'">
+                  {{ scope.$index + 1 }}
                 </span>
-                <span v-else></span>
+                <!-- 只显示父节点的序号 -->
+                <div v-else>
+                  <span v-if="scope.row.children">
+                    {{ getParentNodeIndex(scope.row) }}
+                  </span>
+                  <span v-else></span>
+                </div>
               </template>
             </el-table-column>
             <el-table-column
@@ -129,7 +134,7 @@
               align="left"
             />
             <el-table-column
-              prop="auditObject"
+              :prop="curOrg == '企业单位' ? 'auditedUnitName' : 'auditObject'"
               label="监审对象"
               header-align="center"
               align="left"
@@ -141,8 +146,10 @@
               header-align="center"
               align="center"
               width="120"
+              show-overflow-tooltip
             />
             <el-table-column
+              v-if="curOrg != '企业单位'"
               prop="source"
               label="立项来源"
               header-align="center"
@@ -150,6 +157,7 @@
               width="100"
             />
             <el-table-column
+              v-if="curOrg != '企业单位'"
               prop="form"
               label="监审形式"
               header-align="center"
@@ -173,91 +181,128 @@
             </el-table-column>
             <el-table-column label="操作" align="center" width="260">
               <template slot-scope="scope">
-                <span v-if="!scope.row.isSubTask" class="action-buttons">
-                  <el-button
-                    type="text"
-                    size="small"
-                    @click="handleViewTaskDetail(scope.row)"
-                  >
-                    任务详情
-                  </el-button>
-                  <el-button
-                    type="text"
-                    size="small"
-                    @click="handleOpenMainDetails(scope.row)"
-                  >
-                    任务办理
-                  </el-button>
-                  <el-button
-                    type="text"
-                    size="small"
-                    @click="handleCheckRecord(scope.row)"
-                  >
-                    备忘录
-                  </el-button>
-                </span>
-                <span v-if="scope.row.isSubTask" class="action-buttons">
-                  <el-button
-                    v-if="
-                      scope.row.currentNode === 'clcs' &&
-                      (scope.row.status === '200' || scope.row.status === '600')
-                    "
-                    type="text"
-                    size="small"
-                    @click="handleOpenDetails(scope.row)"
-                  >
-                    资料初审
-                  </el-button>
-                  <el-button
-                    v-if="
-                      (scope.row.currentNode === 'sdsh' ||
-                        scope.row.currentNode === 'yjfk') &&
-                      scope.row.status === '200'
-                    "
-                    type="text"
-                    size="small"
-                    @click="handleOpenDetails(scope.row)"
-                  >
-                    成本审核
-                  </el-button>
+                <div v-if="curOrg == '企业单位'">
                   <el-button
                     v-if="
-                      scope.row.currentNode === 'yjgz' &&
-                      scope.row.status === '200'
+                      (scope.row.currentNode === 'clcs' ||
+                        scope.row.currentNode === 'tjcl') &&
+                      (scope.row.status === '100' ||
+                        scope.row.status === '500' ||
+                        scope.row.status === '600')
                     "
+                    size="mini"
                     type="text"
-                    size="small"
-                    @click="handleOpenDetails(scope.row)"
+                    @click="handleEdit(scope.row)"
                   >
-                    意见告知
+                    填报任务
                   </el-button>
                   <el-button
                     v-if="
                       scope.row.currentNode === 'yjfk' &&
-                      scope.row.status === '260'
+                      scope.row.status === '250'
                     "
+                    size="mini"
                     type="text"
-                    size="small"
-                    @click="handleOpenDetails(scope.row)"
-                  >
-                    审核
-                  </el-button>
-                  <el-button
-                    v-if="scope.row.status === '300'"
-                    type="text"
-                    size="small"
-                    @click="handleHf(scope.row)"
+                    @click="handleEdit(scope.row)"
                   >
-                    恢复
+                    意见反馈
                   </el-button>
                   <el-button
+                    size="mini"
                     type="text"
-                    size="small"
-                    @click="handleMessage(scope.row, 'chengben')"
+                    @click="handleMessage(scope.row)"
                   >
                     查看
                   </el-button>
-                </span>
+                </div>
+                <div v-else>
+                  <span v-if="!scope.row.isSubTask" class="action-buttons">
+                    <el-button
+                      type="text"
+                      size="small"
+                      @click="handleViewTaskDetail(scope.row)"
+                    >
+                      任务详情
+                    </el-button>
+                    <el-button
+                      type="text"
+                      size="small"
+                      @click="handleOpenMainDetails(scope.row)"
+                    >
+                      任务办理
+                    </el-button>
+                    <el-button
+                      type="text"
+                      size="small"
+                      @click="handleCheckRecord(scope.row)"
+                    >
+                      备忘录
+                    </el-button>
+                  </span>
+                  <span v-if="scope.row.isSubTask" class="action-buttons">
+                    <el-button
+                      v-if="
+                        scope.row.currentNode === 'clcs' &&
+                        (scope.row.status === '200' ||
+                          scope.row.status === '600')
+                      "
+                      type="text"
+                      size="small"
+                      @click="handleOpenDetails(scope.row)"
+                    >
+                      资料初审
+                    </el-button>
+                    <el-button
+                      v-if="
+                        (scope.row.currentNode === 'sdsh' ||
+                          scope.row.currentNode === 'yjfk') &&
+                        scope.row.status === '200'
+                      "
+                      type="text"
+                      size="small"
+                      @click="handleOpenDetails(scope.row)"
+                    >
+                      成本审核
+                    </el-button>
+                    <el-button
+                      v-if="
+                        scope.row.currentNode === 'yjgz' &&
+                        scope.row.status === '200'
+                      "
+                      type="text"
+                      size="small"
+                      @click="handleOpenDetails(scope.row)"
+                    >
+                      意见告知
+                    </el-button>
+                    <el-button
+                      v-if="
+                        scope.row.currentNode === 'yjfk' &&
+                        scope.row.status === '260'
+                      "
+                      type="text"
+                      size="small"
+                      @click="handleOpenDetails(scope.row)"
+                    >
+                      审核
+                    </el-button>
+                    <el-button
+                      v-if="scope.row.status === '300'"
+                      type="text"
+                      size="small"
+                      @click="handleHf(scope.row)"
+                    >
+                      恢复
+                    </el-button>
+                    <el-button
+                      type="text"
+                      size="small"
+                      @click="handleMessage(scope.row, 'chengben')"
+                    >
+                      查看
+                    </el-button>
+                  </span>
+                </div>
               </template>
             </el-table-column>
           </el-table>
@@ -497,7 +542,7 @@
   import { memoManageMixin } from '@/views/costAudit/projectInfo/auditProjectManage/memoManage/memoManageMixin'
   import { doProcessBtn } from '@/api/dataPreliminaryReview'
   import { getReviewTaskList } from '@/api/audit/auditIndex'
-  import { getChartList, getMsgList } from '@/api/home'
+  import { getChartList, getMsgList, getEnterpriseList } from '@/api/home'
   import detailsDialog from '@/views/costAudit/auditInfo/auditManage/details.vue'
   import mainDetailsDialog from '@/views/costAudit/auditInfo/auditManage/mainDetails.vue'
   import taskInfo from '@/components/task/taskInfo.vue'
@@ -545,6 +590,7 @@
         cbjsInfoVisible: false,
         cbjsInfoData: null,
         mainDetailsVisible: false,
+        curOrg: '',
       }
     },
     watch: {
@@ -564,6 +610,7 @@
     mounted() {
       this.$el.querySelector('div.el-calendar__header').remove()
       let user = this.$permission.getUserInfo()
+      this.curOrg = this.$store.state.user.userInfo.curOrg
       if (user.dataScope === 0) {
         this.areaCode = user.provinceCode
       } else if (user.dataScope === 1) {
@@ -572,13 +619,17 @@
         this.areaCode = user.countyCode
       }
       this.initChart()
-      this.initCalendarData(5)
+      this.initCalendarData('index')
       this.getTodoList()
       this.loadNewsList()
     },
     methods: {
       getTodoList() {
-        this.loadAuditProjectList()
+        if (this.curOrg === '企业单位') {
+          this.getEnterpriseTodoList()
+        } else {
+          this.loadAuditProjectList()
+        }
       },
       // 加载最新消息
       async loadNewsList() {
@@ -596,6 +647,27 @@
         this.currentPage = 1
         this.loadAuditProjectList()
       },
+      // 获取企业待办列表
+      async getEnterpriseTodoList() {
+        try {
+          this.loading = true
+          const params = {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            projectName: this.todoSearchQuery,
+          }
+          const response = await getEnterpriseList(params)
+
+          if (response.state && response.value) {
+            const records = response.value.records || []
+            this.todoList = records
+          }
+        } catch (error) {
+          console.error('获取企业待办列表失败:', error)
+        } finally {
+          this.loading = false
+        }
+      },
       // 加载审核项目列表
       async loadAuditProjectList() {
         try {

+ 223 - 248
src/views/personal/notice/index.vue

@@ -1,283 +1,258 @@
 <template>
-  <!-- 内部消息 -->
-  <div class="message-container">
-    <div class="top-content">
-      <div class="content__left">
-        <!-- <el-select
-          v-model="messageType"
-          style="width: 88px; margin-right: 10px"
-          @change="search"
+  <div class="content-container">
+    <!-- 表格 -->
+    <div class="table">
+      <el-table v-loading="loading" border :data="list" style="width: 100%">
+        <el-table-column
+          align="center"
+          type="index"
+          label="序号"
+          width="80"
+        ></el-table-column>
+        <el-table-column
+          prop="noticeTitle"
+          label="标题"
+          align="center"
+          width="200"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          prop="noticeSource"
+          label="消息来源"
+          align="center"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          prop="noticeType"
+          label="类型"
+          width="80"
+          align="center"
         >
-          <el-option
-            v-for="item in readOptions"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          ></el-option>
-        </el-select>
-
-        <el-button
-          :disabled="!selectedRows.length"
-          icon="el-icon-delete"
-          @click="handleDelete"
+          <template slot-scope="scope">
+            {{ scope.row.noticeType == 1 ? '通知' : '公告' }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="noticeContent"
+          label="内容"
+          width="500"
+          align="center"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          prop="status"
+          label="状态"
+          width="100"
+          align="center"
+          show-overflow-tooltip
         >
-          删除
-        </el-button>
-
-        <el-button
-          v-show="messageType == 1"
-          :disabled="!selectedRows.length"
-          @click="handleMark"
+          <template slot-scope="scope">
+            {{ scope.row.status == '0' ? '正常' : '关闭' }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="createTime"
+          label="发送时间"
+          width="120"
+          align="center"
+          show-overflow-tooltip
         >
-          <i class="icon-read1" style="font-size: 12px"></i>
-          标记为已读
-        </el-button> -->
-      </div>
-
-      <div class="content__right">
-        <!-- <el-input
-          v-model="searchKey"
-          clearable
-          placeholder="请输入标题"
-          @focus="handleFocus"
-          @blur="handleBlur"
-          @clear="search"
-          @keyup.enter.native="search"
-        ></el-input>
-        <i ref="icon" class="icon-flow-center-search" @click="search"></i> -->
-        <header-search-input
-          search-tips="请输入标题"
-          @search-by-key="searchChange"
-        ></header-search-input>
-      </div>
-    </div>
-
-    <!-- 表格 -->
-    <div class="table">
-      <el-table
-        v-loading="loading"
-        border
-        :data="tableData"
-        :height="tableHeight + 'px'"
-        @sort-change="columnSort"
-        @selection-change="selectionChange"
-      >
-        <el-table-column align="center" type="selection"></el-table-column>
-
-        <el-table-column label="标题">
-          <template #default="{ row }">
-            <div class="msg-subject" @click="readNewsItem(row)">
-              {{ row.title }}
+          <template slot-scope="scope">
+            <div>
+              {{
+                scope.row.createTime ? scope.row.createTime.split(' ')[0] : ''
+              }}
+            </div>
+            <div>
+              {{
+                scope.row.createTime ? scope.row.createTime.split(' ')[1] : ''
+              }}
             </div>
           </template>
         </el-table-column>
-
-        <el-table-column label="部门" prop="department"></el-table-column>
-
-        <el-table-column label="通知时间" prop="createTime"></el-table-column>
-
-        <template slot="empty">
-          <el-image :src="tableNoDataImg"></el-image>
-          <p class="no-data-text">暂无数据</p>
-        </template>
+        <el-table-column
+          prop="action"
+          label="操作"
+          width="120"
+          align="center"
+          fixed="right"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            <el-button type="text" size="mini" @click="handleView(scope.row)">
+              详情
+            </el-button>
+          </template>
+        </el-table-column>
       </el-table>
-
-      <el-row type="flex" justify="end" class="my-pagination">
-        <el-pagination
-          background
-          :current-page="pagination.page"
-          :page-sizes="[10, 20, 30, 50, 100]"
-          :page-size="pagination.pageSize"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="pagination.total"
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-        ></el-pagination>
-      </el-row>
+      <el-pagination
+        class="mt20"
+        background
+        :current-page="search.page"
+        :page-sizes="[50, 100]"
+        :page-size="search.pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      ></el-pagination>
+      <!-- 详情弹窗 -->
+      <el-dialog
+        title="详情"
+        :visible.sync="visible"
+        width="60%"
+        :close-on-click-modal="false"
+      >
+        <el-form ref="form" :model="form" label-width="140px" disabled>
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <el-form-item label="标题:">
+                {{ form.noticeTitle }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="类型:">
+                {{ form.noticeType == 1 ? '通知' : '公告' }}
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <el-form-item label="消息来源:">
+                {{ form.noticeSource }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="发送对象:">
+                {{ getUserName(form.sendTarget) }}
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <el-form-item label="状态:">
+                {{ form.status == '0' ? '正常' : '关闭' }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="发送时间:">
+                {{ form.createTime }}
+              </el-form-item>
+            </el-col>
+            <!-- <el-col :span="12">
+              <el-form-item label="发送人:">
+                {{ form.createBy }}
+              </el-form-item>
+            </el-col> -->
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <el-form-item label="项目名称:">
+                {{ form.projectName }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="被监审单位名称:">
+                {{ form.enterpriseName }}
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="24">
+              <el-form-item label="内容:">
+                {{ form.noticeContent }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="备注:">{{ form.remark }}</el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-dialog>
     </div>
-    <home-news-read-dialog
-      @click="
-        () => {
-          search('pageChange')
-        }
-      "
-      ref="newsRead"
-      :news-id="newsId"
-    ></home-news-read-dialog>
   </div>
 </template>
-
 <script>
-  import { mapGetters } from 'vuex'
-  import { portalNewsNoticeQuery } from '@/api/newApi'
-  import HomeNewsReadDialog from '../../home/components/HomeNewsReadDialog.vue'
-  import HeaderSearchInput from '../../../components/searchInput/HeaderSearchInput.vue'
+  import { getNoticeList, readNotice, getNoticeDetail } from '@/api/home'
   export default {
-    name: 'Message',
-    components: {
-      HomeNewsReadDialog,
-      HeaderSearchInput,
-    },
+    name: 'Home',
     data() {
       return {
-        newsId: '',
-        loading: false,
-        messageVisible: false,
-        searchKey: '',
-        messageType: 1,
-        tableData: [],
-        selectedRows: [],
-        pagination: {
+        search: {
           page: 1,
-          pageSize: 30,
-          total: 0,
+          pageSize: 50,
         },
-
-        sorter: 'desc',
-        tableNoDataImg: require('@/assets/nodata_images/table-no-data.png'),
-        tableHeight: null,
+        list: [],
+        loading: false,
+        total: 0,
+        form: {},
+        visible: false,
       }
     },
     computed: {
-      ...mapGetters({
-        themeColor: 'settings/themeColor',
-      }),
-      // tableHeight() {
-      //   return this.$baseTableHeight(-30)
-      // },
+      user() {
+        return this.$store.state.user.userInfo.user
+      },
     },
     mounted() {
-      this.search()
-      this.tableHeight =
-        this.$baseTableHeight(-30) > 220 ? this.$baseTableHeight(-30) : 220
-      this.$root.$on('resize', () => {
-        this.tableHeight =
-          this.$baseTableHeight(-30) > 220 ? this.$baseTableHeight(-30) : 220
-      })
+      this.getList()
     },
     methods: {
-      handleFocus() {
-        this.$refs.icon.style.color = this.themeColor
-      },
-      handleBlur() {
-        this.$refs.icon.style.color = '#c0c4cc'
-      },
-      columnSort({ order }) {
-        this.sorter = order ? (order == 'ascending' ? 'asc' : 'desc') : ''
-        this.search()
-      },
-      selectionChange(selection) {
-        this.selectedRows = selection
-      },
-      readNewsItem(news) {
-        this.newsId = news.id
-        this.$refs.newsRead.showDialog()
-      },
-      handleSizeChange(size) {
-        this.pagination.pageSize = size
-        this.search()
-      },
-      handleCurrentChange(currentPage) {
-        this.pagination.page = currentPage
-        this.search('pageChange')
-      },
-      searchChange(searchKey) {
-        this.searchKey = searchKey
-        this.search()
-      },
-      search(isPageChange) {
-        this.loading = true
-        if (!isPageChange) {
-          this.pagination.page = 1
-        }
-        const queryFilter = {
-          pageBean: this.pagination,
-          querys: [
-            {
-              group: 'advance',
-              operation: 'EQUAL',
-              property: 'classifyId',
-              relation: 'AND',
-              value: '1751879898894467072',
-            },
-          ],
-          sorter: [{ direction: 'DESC', property: 'PUBLISH_TIME_' }],
-        }
-        if (this.messageType === 2) {
-          queryFilter.params = {
-            receiveTimeOrder: this.sorter,
+      // 获取更多消息列表
+      async getList() {
+        let user = this.user
+        try {
+          this.loading = true
+          let params = {
+            ...this.search,
+            sendTarget: user.userId,
           }
+          const res = await getNoticeList(params)
+          if (res.value && res.value.records.length > 0) {
+            this.list = res.value.records || []
+            this.total = res.value.total || 0
+          }
+        } catch (error) {
+          console.log(error)
+        } finally {
+          this.loading = false
         }
-        if (this.searchKey !== '') {
-          queryFilter.querys.push({
-            property: 'title',
-            value: '%' + this.searchKey + '%',
-            group: 'quick',
-            operation: 'LIKE',
-            relation: 'OR',
-          })
-        }
-        portalNewsNoticeQuery(queryFilter).then((data) => {
-          if (data) {
-            this.pagination = {
-              page: data.page,
-              pageSize: data.pageSize,
-              total: data.total,
+      },
+      // 详情
+      handleView(row) {
+        readNotice({ id: row.noticeId }).then(() => {
+          this.getList()
+        })
+        getNoticeDetail({ id: row.noticeId }).then((res) => {
+          if (res.value) {
+            this.form = {
+              ...res.value,
             }
-            this.tableData = data.rows ? data.rows : []
+            this.visible = true
           }
-          setTimeout(() => {
-            this.loading = false
-          }, 300)
         })
       },
+      // 分页大小改变
+      handleSizeChange(val) {
+        this.search.pageSize = val
+        this.getList()
+      },
+      // 分页当前页改变
+      handleCurrentChange(val) {
+        this.search.page = val
+        this.getList()
+      },
+      // 获取用户姓名
+      getUserName(userId) {
+        let user = this.user
+        if (user.userId == userId) {
+          return user.fullname || user.userName
+        }
+        return ''
+      },
     },
   }
 </script>
-
 <style lang="scss" scoped>
-  .message-container {
-    width: 100%;
-    // height: calc(100% - #{$base-margin});
-    height: 100% !important;
-    background: $base-color-white !important;
-    .top-content {
-      display: flex;
-      flex-wrap: wrap;
-      align-items: center;
-      justify-content: space-between;
-      padding: $base-padding;
-      .content__right {
-        position: relative;
-        i {
-          position: absolute;
-          top: 0px;
-          right: 0px;
-          width: 30px;
-          height: 32px;
-          font-size: 14px;
-          line-height: 32px;
-          color: #c0c4cc;
-          text-align: center;
-          cursor: pointer;
-        }
-        ::v-deep .el-input {
-          width: 268px;
-          .el-input__inner {
-            padding-right: 60px;
-          }
-          .el-input__suffix {
-            right: 30px;
-          }
-        }
-      }
-    }
-    .table {
-      padding: 0 $base-padding;
-      .msg-subject {
-        color: var(--themeColor);
-        cursor: pointer;
-      }
-    }
-  }
+  @import '@/styles/costAudit.scss';
 </style>

+ 1 - 0
vue.config.js

@@ -47,6 +47,7 @@ module.exports = {
       warnings: true,
       errors: true,
     },
+    disableHostCheck: true,
     after: mockServer(),
   },
   configureWebpack(config) {