Przeglądaj źródła

资料初审按钮接口及点击按钮接口对接,消息通知接口对接

shiyanyu 1 miesiąc temu
rodzic
commit
e84ab012ad

+ 6 - 6
public/config.js

@@ -4,8 +4,8 @@
 // var host = 'http://116.204.117.33' //基本用这个
 // var host = 'http://101.33.208.140' // 测试
 // var host = 'http://b463f4b7.natappfree.cc' // 后端服务海鹏
-// var host = 'http://5jrgep.ipx.wanziwk.cn' // 后端服务译文
-var host = 'http://192.168.1.2' // 后端服务译文
+var host = 'http://5jrgep.ipx.wanziwk.cn' // 后端服务译文
+// var host = 'http://192.168.1.2' // 后端服务译文
 // var host = 'http://localhost'
 // combine为true时五合一部署, 为false时分五个服务部署
 var combine = true
@@ -23,14 +23,14 @@ var defaultModulePortMap = {
 window.getModuleRootUrl = function (module) {
   // 默认是全部服务合一的端口
   // var modulePort = '8089' // 以前
-  var modulePort = '9506' // 基本用这个
+  // var modulePort = '9506' // 基本用这个
   // var modulePort = '8088' //测试
-  // var modulePort = ''
+  var modulePort = ''
   if (!combine) {
     modulePort = defaultModulePortMap[module]
   }
-  return host + ':' + modulePort
-  // return host + modulePort
+  // return host + ':' + modulePort
+  return host + modulePort
 }
 window.context = {
   manage: host + ':8280/mvue', //管理端页面

+ 9 - 0
src/api/auditTaskProcessing.js

@@ -43,3 +43,12 @@ export function submitTaskRequirement(data) {
     data: data,
   })
 }
+
+// 消息通知
+export function sendMessage(data) {
+  return request({
+    url: url + '/api/costNotice/v1/pageList',
+    method: 'post',
+    data: data,
+  })
+}

+ 20 - 0
src/api/dataPreliminaryReview.js

@@ -0,0 +1,20 @@
+import request from '@/utils/request'
+const url = window.context.form
+
+// 获取资料初审按钮
+export function getDataPreliminaryReviewButton(data) {
+  return request({
+    url: url + '/api/enterprise/reviewTask/getProcessBtn',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 获取资料初审按钮点击接口
+export function doProcessBtn(data) {
+  return request({
+    url: url + '/api/enterprise/reviewTask/doProcessBtn',
+    method: 'post',
+    data: data,
+  })
+}

+ 106 - 12
src/components/task/taskInfo.vue

@@ -406,7 +406,7 @@
           <div v-loading="loading" element-loading-text="加载中...">
             <el-table
               style="width: 100%"
-              :data="formData.costSurveyData"
+              :data="paginatedCostSurveyData"
               border
               size="small"
             >
@@ -452,6 +452,17 @@
                 </template>
               </el-table-column>
             </el-table>
+            <el-pagination
+              background
+              layout="total, sizes, prev, pager, next"
+              :current-page="costSurveyPagination.currentPage"
+              :page-sizes="[10, 20, 30, 50]"
+              :page-size="costSurveyPagination.pageSize"
+              :total="costSurveyPagination.total"
+              style="margin-top: 20px; text-align: right"
+              @current-change="handleCostSurveyPageChange"
+              @size-change="handleCostSurveySizeChange"
+            />
           </div>
         </el-tab-pane>
 
@@ -558,30 +569,41 @@
                 </template>
               </el-table-column>
               <el-table-column
-                prop="name"
+                prop="noticeTitle"
                 label="消息主题"
                 width="200"
                 align="center"
               ></el-table-column>
               <el-table-column
-                prop="province"
+                prop="noticeSource"
                 label="消息来源"
                 width="150"
                 align="center"
               ></el-table-column>
               <el-table-column
-                prop="city"
+                prop="noticeContent"
                 label="消息内容"
                 min-width="350"
                 align="center"
               ></el-table-column>
               <el-table-column
-                prop="address"
+                prop="createTime"
                 label="发送时间"
                 width="180"
                 align="center"
               ></el-table-column>
             </el-table>
+            <el-pagination
+              background
+              layout="total, sizes, prev, pager, next"
+              :current-page="messageNoticePagination.currentPage"
+              :page-sizes="[10, 20, 30, 50]"
+              :page-size="messageNoticePagination.pageSize"
+              :total="messageNoticePagination.total"
+              style="margin-top: 20px; text-align: right"
+              @current-change="handleMessageNoticePageChange"
+              @size-change="handleMessageNoticeSizeChange"
+            />
           </div>
         </el-tab-pane>
       </el-tabs>
@@ -603,6 +625,7 @@
   import {
     getProjectInformationInfo,
     getTaskRequirementList,
+    sendMessage,
   } from '@/api/auditTaskProcessing'
 
   export default {
@@ -638,6 +661,18 @@
           auditOpinion: false,
           messageNotice: false,
         },
+        // 成本调查表分页相关
+        costSurveyPagination: {
+          currentPage: 1,
+          pageSize: 10,
+          total: 0,
+        },
+        // 消息通知分页相关
+        messageNoticePagination: {
+          currentPage: 1,
+          pageSize: 10,
+          total: 0,
+        },
         unitList: [],
         OrgList: [],
         userList: [],
@@ -741,6 +776,14 @@
 
         return result
       },
+      // 分页后的成本调查表数据
+      paginatedCostSurveyData() {
+        const start =
+          (this.costSurveyPagination.currentPage - 1) *
+          this.costSurveyPagination.pageSize
+        const end = start + this.costSurveyPagination.pageSize
+        return this.formData.costSurveyData.slice(start, end)
+      },
     },
     watch: {
       visible: {
@@ -812,6 +855,12 @@
           this.tabLoadedStatus[key] = false
         })
 
+        // 重置分页状态
+        this.costSurveyPagination.currentPage = 1
+        this.costSurveyPagination.total = 0
+        this.messageNoticePagination.currentPage = 1
+        this.messageNoticePagination.total = 0
+
         if (data) {
           // 保存任务信息
           this.currentTaskInfo = {
@@ -998,14 +1047,18 @@
           // const res = await getCostSurveyList(this.currentTaskInfo.taskId)
           // if (res && res.code === 200) {
           //   this.formData.costSurveyData = res.value || []
+          //   this.costSurveyPagination.total = this.formData.costSurveyData.length
           // }
 
           // 暂时使用mock数据
           this.formData.costSurveyData = []
+          this.costSurveyPagination.total = this.formData.costSurveyData.length
           this.tabLoadedStatus.costSurvey = true
         } catch (error) {
           console.error('加载成本调查表失败:', error)
           this.$message.error('加载成本调查表失败')
+          this.formData.costSurveyData = []
+          this.costSurveyPagination.total = 0
         } finally {
           this.loading = false
         }
@@ -1031,20 +1084,33 @@
       },
       // 加载消息通知
       async loadMessageNotice() {
+        if (!this.currentTaskInfo?.taskId) {
+          return
+        }
+
         try {
           this.loading = true
-          // TODO: 调用消息通知接口
-          // const res = await getMessageNoticeList(this.currentTaskInfo.taskId)
-          // if (res && res.code === 200) {
-          //   this.formData.messageNotice = res.value || []
-          // }
+          const params = {
+            taskId: this.currentTaskInfo.taskId,
+            currentPage: this.messageNoticePagination.currentPage,
+            pageSize: this.messageNoticePagination.pageSize,
+          }
+          const res = await sendMessage(params)
 
-          // 暂时使用mock数据
-          this.formData.messageNotice = []
+          console.log('消息通知接口返回:', res)
+          if (res && res.code === 200 && res.value && res.value.value) {
+            this.formData.messageNotice = res.value.value.records || []
+            this.messageNoticePagination.total = res.value.value.total || 0
+          } else {
+            this.formData.messageNotice = []
+            this.messageNoticePagination.total = 0
+          }
           this.tabLoadedStatus.messageNotice = true
         } catch (error) {
           console.error('加载消息通知失败:', error)
           this.$message.error('加载消息通知失败')
+          this.formData.messageNotice = []
+          this.messageNoticePagination.total = 0
         } finally {
           this.loading = false
         }
@@ -1095,6 +1161,34 @@
       deleteCostYear(index) {
         // 只读模式,无需处理
       },
+
+      // 成本调查表分页 - 页码改变
+      handleCostSurveyPageChange(page) {
+        this.costSurveyPagination.currentPage = page
+        // 如果成本调查表数据来自API,可以在这里调用API
+        // this.loadCostSurvey()
+      },
+
+      // 成本调查表分页 - 每页条数改变
+      handleCostSurveySizeChange(size) {
+        this.costSurveyPagination.pageSize = size
+        this.costSurveyPagination.currentPage = 1
+        // 如果成本调查表数据来自API,可以在这里调用API
+        // this.loadCostSurvey()
+      },
+
+      // 消息通知分页 - 页码改变
+      handleMessageNoticePageChange(page) {
+        this.messageNoticePagination.currentPage = page
+        this.loadMessageNotice()
+      },
+
+      // 消息通知分页 - 每页条数改变
+      handleMessageNoticeSizeChange(size) {
+        this.messageNoticePagination.pageSize = size
+        this.messageNoticePagination.currentPage = 1
+        this.loadMessageNotice()
+      },
     },
   }
 </script>

+ 178 - 9
src/views/EntDeclaration/auditTaskManagement/taskFillIn.vue

@@ -525,7 +525,7 @@
         <el-tab-pane label="成本调查表" name="costSurvey">
           <el-table
             style="width: 100%; margin-top: 20px"
-            :data="formData.costSurveyData"
+            :data="paginatedCostSurveyData"
             border
             size="medium"
           >
@@ -647,6 +647,17 @@
               </template>
             </el-table-column>
           </el-table>
+          <el-pagination
+            background
+            layout="total, sizes, prev, pager, next"
+            :current-page="costSurveyPagination.currentPage"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="costSurveyPagination.pageSize"
+            :total="costSurveyPagination.total"
+            style="margin-top: 20px; text-align: right"
+            @current-change="handleCostSurveyPageChange"
+            @size-change="handleCostSurveySizeChange"
+          />
         </el-tab-pane>
 
         <!-- 监审意见 -->
@@ -741,7 +752,7 @@
           <el-table
             style="width: 100%; margin-top: 20px"
             border
-            :data="formData.auditDocument"
+            :data="formData.messageNoticeData"
           >
             <el-table-column prop="id" label="序号" width="120" align="center">
               <template slot-scope="scope">
@@ -749,30 +760,41 @@
               </template>
             </el-table-column>
             <el-table-column
-              prop="name"
+              prop="noticeTitle"
               label="消息主题"
               width="200"
               align="center"
             ></el-table-column>
             <el-table-column
-              prop="province"
+              prop="noticeSource"
               label="消息来源"
               width="150"
               align="center"
             ></el-table-column>
             <el-table-column
-              prop="city"
+              prop="noticeContent"
               label="消息内容"
               min-width="350"
               align="center"
             ></el-table-column>
             <el-table-column
-              prop="address"
+              prop="createTime"
               label="发送时间"
               width="230"
               align="center"
             ></el-table-column>
           </el-table>
+          <el-pagination
+            background
+            layout="total, sizes, prev, pager, next"
+            :current-page="messageNoticePagination.currentPage"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="messageNoticePagination.pageSize"
+            :total="messageNoticePagination.total"
+            style="margin-top: 20px; text-align: right"
+            @current-change="handleMessageNoticePageChange"
+            @size-change="handleMessageNoticeSizeChange"
+          />
         </el-tab-pane>
       </el-tabs>
     </div>
@@ -903,6 +925,7 @@
     getTaskRequirementList,
     addOrUpdateTaskRequirement,
     submitTaskRequirement,
+    sendMessage,
   } from '@/api/auditTaskProcessing'
   import RegionSelector from '@/views/costAudit/projectInfo/auditProjectManage/annualReviewPlan/RegionSelector.vue'
   import CatalogCascader from '@/views/costAudit/projectInfo/auditProjectManage/annualReviewPlan/CatalogCascader.vue'
@@ -954,6 +977,18 @@
         isDisabled: false,
         tabCheck: '', // 状态判断监审意见是否显示
         tabVisiable: true, // 标签页是否显示
+        // 成本调查表分页相关
+        costSurveyPagination: {
+          currentPage: 1,
+          pageSize: 10,
+          total: 0,
+        },
+        // 消息通知分页相关
+        messageNoticePagination: {
+          currentPage: 1,
+          pageSize: 10,
+          total: 0,
+        },
         // 所有表单数据聚合
         formData: {
           basicInfo: {
@@ -1160,6 +1195,7 @@
           children: 'children',
           label: 'label',
         },
+        messageNoticeData: [],
         // 补充材料弹窗相关数据
         materialDialogVisible: false,
         materialForm: {
@@ -1274,6 +1310,14 @@
 
         return result
       },
+      // 分页后的成本调查表数据
+      paginatedCostSurveyData() {
+        const start =
+          (this.costSurveyPagination.currentPage - 1) *
+          this.costSurveyPagination.pageSize
+        const end = start + this.costSurveyPagination.pageSize
+        return this.formData.costSurveyData.slice(start, end)
+      },
     },
     mounted() {
       this.getAllUnitList()
@@ -1300,6 +1344,8 @@
       } else {
         this.getProjectInformation()
       }
+      // 初始化成本调查表分页总数
+      this.costSurveyPagination.total = this.formData.costSurveyData.length
     },
     methods: {
       getAllUnitList() {
@@ -1399,6 +1445,8 @@
           this.getProjectInformation()
         } else if (tab.name === 'dataRequirements') {
           this.getTaskRequirementPage() // 报送资料要求
+        } else if (tab.name === 'messageNotice') {
+          this.getSendMessage() // 消息通知
         }
         // 可添加标签页切换时的逻辑
         this.pageTitle = tab.label
@@ -1444,6 +1492,30 @@
             this.formData.dataRequirements = []
           })
       },
+      // 消息通知
+      getSendMessage() {
+        const params = {
+          taskId: this.taskId,
+          currentPage: this.messageNoticePagination.currentPage,
+          pageSize: this.messageNoticePagination.pageSize,
+        }
+        sendMessage(params)
+          .then((res) => {
+            console.log('消息通知', res)
+            if (res && res.code === 200 && res.value && res.value.value) {
+              this.formData.messageNoticeData = res.value.value.records || []
+              this.messageNoticePagination.total = res.value.value.total || 0
+            } else {
+              this.formData.messageNoticeData = []
+              this.messageNoticePagination.total = 0
+            }
+          })
+          .catch((err) => {
+            console.error('获取消息通知失败', err)
+            this.formData.messageNoticeData = []
+            this.messageNoticePagination.total = 0
+          })
+      },
 
       // 提交
       handleSubmit() {
@@ -1497,10 +1569,31 @@
       // 查看文书
       handleClick(row) {
         console.log(row)
+        if (row.fileUrl) {
+          window.open(row.fileUrl, '_blank')
+        } else {
+          this.$message.warning('暂无文件可查看')
+        }
       },
       // 下载文书
       handleDownload(row) {
         console.log(row)
+        if (!row.fileUrl) {
+          this.$message.warning('该文书暂无文件可下载')
+          return
+        }
+
+        // 创建隐藏的a标签进行下载
+        const link = document.createElement('a')
+        link.style.display = 'none'
+        link.href = row.fileUrl
+        // 设置下载文件名
+        link.download = row.name || '文书文件'
+        document.body.appendChild(link)
+        link.click()
+        document.body.removeChild(link)
+
+        this.$message.success('开始下载文件')
       },
       // 上传附件
       handleUpload(row) {
@@ -1511,10 +1604,30 @@
       handleFileView(row) {
         console.log('查看文件:', row)
         // 实际开发中可添加文件预览逻辑(如打开新窗口、弹窗展示等)
+        if (row.fileUrl) {
+          window.open(row.fileUrl, '_blank')
+        } else {
+          this.$message.warning('暂无文件可查看')
+        }
       },
       handleFileDownload(row) {
         console.log('下载文件:', row)
-        // 实际开发中可添加文件下载逻辑(如调用后端下载接口)
+        if (!row.fileUrl) {
+          this.$message.warning('该资料暂无文件可下载')
+          return
+        }
+
+        // 创建隐藏的a标签进行下载
+        const link = document.createElement('a')
+        link.style.display = 'none'
+        link.href = row.fileUrl
+        // 设置下载文件名,优先使用资料名称
+        link.download = row.informationName || '下载文件'
+        document.body.appendChild(link)
+        link.click()
+        document.body.removeChild(link)
+
+        this.$message.success('开始下载文件')
       },
       // 报送资料文件上传
       async handleFileUpload(row) {
@@ -1611,7 +1724,21 @@
       },
       handleTemplateDownload(row) {
         console.log('下载预置模版:', row)
-        // 实际开发中可添加模版文件下载逻辑
+        if (!row.templateUrl && !row.fileUrl) {
+          this.$message.warning('该模版暂无文件可下载')
+          return
+        }
+
+        const downloadUrl = row.templateUrl || row.fileUrl
+        const link = document.createElement('a')
+        link.style.display = 'none'
+        link.href = downloadUrl
+        link.download = row.name ? `${row.name}_模版` : '模版文件'
+        document.body.appendChild(link)
+        link.click()
+        document.body.removeChild(link)
+
+        this.$message.success('开始下载模版')
       },
       handleDataUpload(row) {
         console.log('上传模版数据:', row)
@@ -1652,7 +1779,21 @@
       // 数据下载
       handleDataDownload(row) {
         console.log('数据下载:', row.name)
-        // 实际逻辑:调用下载接口
+        if (!row.fileUrl && !row.dataUrl) {
+          this.$message.warning('该数据暂无文件可下载')
+          return
+        }
+
+        const downloadUrl = row.dataUrl || row.fileUrl
+        const link = document.createElement('a')
+        link.style.display = 'none'
+        link.href = downloadUrl
+        link.download = row.name ? `${row.name}_数据` : '数据文件'
+        document.body.appendChild(link)
+        link.click()
+        document.body.removeChild(link)
+
+        this.$message.success('开始下载数据')
       },
 
       // 补充材料相关方法
@@ -1958,6 +2099,34 @@
         this.materialForm.fileList = fileList
         this.$message.info(`${file.name} 已移除`)
       },
+
+      // 成本调查表分页 - 页码改变
+      handleCostSurveyPageChange(page) {
+        this.costSurveyPagination.currentPage = page
+        // 如果成本调查表数据来自API,可以在这里调用API
+        // this.getCostSurveyData()
+      },
+
+      // 成本调查表分页 - 每页条数改变
+      handleCostSurveySizeChange(size) {
+        this.costSurveyPagination.pageSize = size
+        this.costSurveyPagination.currentPage = 1
+        // 如果成本调查表数据来自API,可以在这里调用API
+        // this.getCostSurveyData()
+      },
+
+      // 消息通知分页 - 页码改变
+      handleMessageNoticePageChange(page) {
+        this.messageNoticePagination.currentPage = page
+        this.getSendMessage()
+      },
+
+      // 消息通知分页 - 每页条数改变
+      handleMessageNoticeSizeChange(size) {
+        this.messageNoticePagination.pageSize = size
+        this.messageNoticePagination.currentPage = 1
+        this.getSendMessage()
+      },
     },
   }
 </script>

+ 50 - 5
src/views/costAudit/auditInfo/auditManage/auditReview.vue

@@ -2,12 +2,20 @@
   <div class="audit-review">
     <!-- 操作按钮区域 -->
     <div class="btn-group">
-      <el-button type="primary" @click="handleAuditPass">初审通过</el-button>
+      <!-- <el-button type="primary" @click="handleAuditPass">初审通过</el-button>
       <el-button type="primary" @click="showRejectDialog = true">
         初审退回
       </el-button>
       <el-button type="primary" @click="showAbortDialog = true">
         中止监审
+      </el-button> -->
+      <el-button
+        v-for="item in buttonData"
+        :key="item.id"
+        type="primary"
+        @click="handleAuditPass(item)"
+      >
+        {{ item.value }}
       </el-button>
       <el-button @click="handleBack">返回</el-button>
     </div>
@@ -316,6 +324,10 @@
     getTaskRequirementList,
     addOrUpdateTaskRequirement,
   } from '@/api/audit/auditIndex'
+  import {
+    getDataPreliminaryReviewButton,
+    doProcessBtn,
+  } from '@/api/dataPreliminaryReview'
 
   export default {
     name: 'AuditReview',
@@ -324,9 +336,14 @@
         type: [String, Number],
         default: null,
       },
+      currentNode: {
+        type: String,
+        default: '',
+      },
     },
     data() {
       return {
+        buttonData: [], //资料初审按钮数据
         activeTab: 'materials', // 当前激活的标签页
         showRejectDialog: false, // 初审退回弹窗显示状态
         showAbortDialog: false, // 中止监审弹窗显示状态
@@ -435,10 +452,24 @@
     },
     mounted() {
       if (this.id) {
+        this.getPreliminaryReviewButton()
         this.loadMaterialData()
       }
     },
     methods: {
+      // 获取资料初审按钮
+      async getPreliminaryReviewButton() {
+        const params = {
+          taskId: this.id,
+          // taskId: '1977383902654959616',
+          // processNodeKey: this.currentNode,
+          processNodeKey:
+            this.currentNode === 'ccls' ? 'clcs' : this.currentNode,
+        }
+        const response = await getDataPreliminaryReviewButton(params)
+        console.log('接口返回数据:', response)
+        this.buttonData = response.value
+      },
       // 加载报送资料数据
       async loadMaterialData() {
         try {
@@ -525,16 +556,30 @@
         }
         return formatMap[formatRequired] || '文档文件'
       },
-      // 初审通过
-      handleAuditPass() {
-        this.$confirm('确定要初审通过吗?', '提示', {
+      // 资料初审按钮点击事件
+      handleAuditPass(row) {
+        this.$confirm(`确定要${row.value}吗?`, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning',
         })
           .then(() => {
-            this.$message({ type: 'success', message: '初审通过操作已提交' })
             // 这里可以添加初审通过的API调用逻辑
+            doProcessBtn({
+              taskId: this.id,
+              key: row.key,
+            })
+              .then((res) => {
+                console.log('接口返回数据:', res)
+                if (res.code === 200 && res.value) {
+                  this.$message({ type: 'success', message: res.value })
+                } else {
+                  this.$message({ type: 'error', message: res.message })
+                }
+              })
+              .catch((err) => {
+                this.$message({ type: 'error', message: err.message })
+              })
           })
           .catch(() => {
             this.$message({ type: 'info', message: '已取消操作' })

+ 9 - 3
src/views/costAudit/auditInfo/auditManage/index.vue

@@ -104,8 +104,8 @@
             <span v-if="scope.row.isSubTask" class="action-buttons">
               <el-button
                 v-if="
-                  (scope.row.currentNode =
-                    'clcs' && scope.row.status === '审核中')
+                  scope.row.currentNode === 'ccls' &&
+                  scope.row.status === '审核中'
                 "
                 type="text"
                 @click="handleAuditReview(scope.row)"
@@ -177,7 +177,11 @@
         </el-breadcrumb-item>
         <el-breadcrumb-item>资料初审</el-breadcrumb-item>
       </el-breadcrumb>
-      <auditReview :id="currentProject.id" @handleBack="backToList" />
+      <auditReview
+        :id="currentProject.id"
+        :current-node="currentProject.currentNode"
+        @handleBack="backToList"
+      />
     </div>
     <div v-else-if="activeView === 'costAudit'">
       <el-breadcrumb
@@ -401,6 +405,8 @@
       // 返回列表
       backToList() {
         this.activeView = 'list'
+        // 刷新列表数据
+        this.loadAuditProjectList()
       },
 
       // 返回详情