suhp hai 1 mes
pai
achega
d7c04adc3e

+ 9 - 0
src/api/audit/auditIndex.js

@@ -17,3 +17,12 @@ export function getTaskRequirementList(taskId) {
     method: 'get',
   })
 }
+
+// 新增/更新报送资料要求
+export function addOrUpdateTaskRequirement(data) {
+  return request({
+    url: url + '/costProjectTaskMaterial/v1/save',
+    method: 'post',
+    data: data,
+  })
+}

+ 161 - 23
src/views/costAudit/auditInfo/auditManage/auditReview.vue

@@ -77,38 +77,60 @@
               width="150"
               align="center"
             />
-
-            <el-table-column label="操作" width="120" align="center">
-              <template slot-scope="scope">
-                <el-button
-                  type="text"
-                  size="small"
-                  @click="handleViewDownload(scope.row)"
-                >
-                  查看 下载
-                </el-button>
-              </template>
-            </el-table-column>
-
             <el-table-column label="初审结果" width="100" align="center">
               <template slot-scope="scope">
                 <span
                   :class="{
-                    'result-pass': scope.row.auditResult === '通过',
-                    'result-fail': scope.row.auditResult === '不通过',
+                    'result-pass': scope.row.auditedStatus === '通过',
+                    'result-fail': scope.row.auditedStatus === '不通过',
                   }"
                 >
-                  {{ scope.row.auditResult || '-' }}
+                  {{ scope.row.auditedStatus || '-' }}
                 </span>
               </template>
             </el-table-column>
+            <el-table-column label="操作" width="200" align="center">
+              <template slot-scope="scope">
+                <template
+                  v-if="
+                    scope.row.filePath ||
+                    scope.row.fileId ||
+                    scope.row.fileName ||
+                    scope.row.uploaded === '已上传'
+                  "
+                >
+                  <el-button
+                    v-if="
+                      !scope.row.auditedStatus || scope.row.auditedStatus === 0
+                    "
+                    type="text"
+                    size="small"
+                    @click="handleAuditMaterial(scope.row)"
+                  >
+                    审核
+                  </el-button>
+                  <el-button
+                    type="text"
+                    size="small"
+                    @click="handleViewDownload(scope.row)"
+                  >
+                    查看
+                  </el-button>
+                </template>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
       </el-tab-pane>
 
       <!-- 成本调查表标签页 -->
       <el-tab-pane label="成本调查表" name="costSurvey">
-        <el-table :data="costSurveyData" border style="width: 100%">
+        <el-table
+          v-loading="loading"
+          :data="costSurveyData"
+          border
+          style="width: 100%"
+        >
           <el-table-column
             prop="id"
             label="序号"
@@ -257,11 +279,43 @@
         <el-button type="primary" @click="handleAbortSubmit">发送</el-button>
       </div>
     </el-dialog>
+
+    <!-- 资料审核弹窗 -->
+    <el-dialog
+      title="资料审核"
+      :visible.sync="showAuditDialog"
+      width="400px"
+      center
+    >
+      <div class="audit-material-info">
+        <p>
+          <strong>资料名称:</strong>
+          {{
+            (currentAuditMaterial && currentAuditMaterial.informationName) || ''
+          }}
+        </p>
+      </div>
+      <el-form ref="auditForm" :model="auditForm" label-width="80px">
+        <el-form-item label="审核结果" prop="auditedStatus">
+          <el-radio-group v-model="auditForm.auditedStatus">
+            <el-radio label="通过">审核通过</el-radio>
+            <el-radio label="不通过">审核拒绝</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="showAuditDialog = false">取消</el-button>
+        <el-button type="primary" @click="handleAuditSubmit">提交</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-  import { getTaskRequirementList } from '@/api/audit/auditIndex'
+  import {
+    getTaskRequirementList,
+    addOrUpdateTaskRequirement,
+  } from '@/api/audit/auditIndex'
 
   export default {
     name: 'AuditReview',
@@ -291,6 +345,15 @@
           sendMethods: ['站内消息', '短信通知'],
         },
 
+        // 资料审核弹窗状态
+        showAuditDialog: false,
+        // 当前审核的资料
+        currentAuditMaterial: null,
+        // 资料审核表单数据
+        auditForm: {
+          auditedStatus: '通过', // 默认审核通过
+        },
+
         // 报送资料表格数据
         materialData: [],
         // 按类型分组的材料数据
@@ -361,10 +424,15 @@
         ],
       }
     },
-    mounted() {
-      this.loadMaterialData()
+    watch: {
+      // 监听标签页切换事件
+      activeTab(newTab) {
+        // 当切换到成本调查表标签页时,模拟加载过程
+        if (newTab === 'costSurvey') {
+          this.loadCostSurveyData()
+        }
+      },
     },
-
     mounted() {
       if (this.id) {
         this.loadMaterialData()
@@ -391,6 +459,22 @@
           this.loading = false
         }
       },
+      // 加载成本调查表数据(模拟异步加载)
+      async loadCostSurveyData() {
+        try {
+          this.loading = true
+          // 模拟网络请求延迟
+          await new Promise((resolve) => setTimeout(resolve, 500))
+          // 这里可以添加实际的API调用逻辑
+          // 目前使用已有的静态数据
+        } catch (error) {
+          console.error('获取成本调查表数据失败:', error)
+          this.$message.error('获取成本调查表数据失败')
+        } finally {
+          this.loading = false
+        }
+      },
+
       // 处理材料数据按类型分组
       processMaterialData() {
         // 确保 materialData 存在且为数组
@@ -419,9 +503,14 @@
           groupedData[type].items.push(item)
         })
 
-        // 按指定顺序排列
-        this.materialCategories = [][('1', '2', '3')].forEach((type) => {
+        // 按指定顺序排列并为每个分类下的材料重新分配序号
+        this.materialCategories = []
+        ;['1', '2', '3'].forEach((type) => {
           if (groupedData[type]) {
+            // 为当前分类下的材料重新分配序号,从1开始递增
+            groupedData[type].items.forEach((item, index) => {
+              item.orderNum = index + 1
+            })
             this.materialCategories.push(groupedData[type])
           }
         })
@@ -518,6 +607,44 @@
         // 这里可以添加查看报表的逻辑
       },
 
+      // 处理资料审核点击事件
+      handleAuditMaterial(row) {
+        this.currentAuditMaterial = { ...row } // 复制当前行数据
+        this.auditForm = {
+          auditedStatus:
+            this.currentAuditMaterial.auditResult === '通过'
+              ? '通过'
+              : '不通过',
+          auditOpinion: '',
+        }
+        this.showAuditDialog = true
+      },
+
+      // 提交资料审核结果
+      async handleAuditSubmit() {
+        try {
+          this.loading = true
+          // 更新当前审核材料的审核状态
+          this.currentAuditMaterial.auditedStatus = this.auditForm.auditedStatus
+          this.currentAuditMaterial.auditResult = this.auditForm.auditedStatus
+
+          // 调用接口提交整个对象
+          await addOrUpdateTaskRequirement(this.currentAuditMaterial)
+
+          this.$message({ type: 'success', message: '资料审核操作已提交' })
+
+          // 更新本地数据,使表格显示最新审核结果
+          this.loadMaterialData()
+
+          this.showAuditDialog = false
+        } catch (error) {
+          console.error('资料审核提交失败:', error)
+          this.$message.error('资料审核提交失败,请重试')
+        } finally {
+          this.loading = false
+        }
+      },
+
       // 返回上一页
       handleBack() {
         // this.$router.back();
@@ -582,4 +709,15 @@
   .el-dialog__body {
     padding: 20px;
   }
+
+  .audit-material-info {
+    margin-bottom: 15px;
+    padding: 10px;
+    background-color: #f5f7fa;
+    border-radius: 4px;
+  }
+
+  .audit-material-info p {
+    margin: 0;
+  }
 </style>