Bläddra i källkod

fix:修改任务制定-报送资料要求,成本调查表的调用接口

luzhixia 1 månad sedan
förälder
incheckning
b0c613423f

+ 1 - 1
src/views/costAudit/baseInfo/catalogManage/index.vue

@@ -2027,7 +2027,7 @@
           informationName: '',
           formatRequired: '',
           isRequired: '0',
-          orderNum: 1,
+          orderNum: this.legalBasisData.length + 1,
         }
         this.legalDialogVisible = true
       },

+ 44 - 33
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/materialTab.vue

@@ -26,6 +26,7 @@
           v-model="scope.row.orderNum"
           size="mini"
           style="width: 60px"
+          :disabled="isView"
           @blur="handleSortChange(scope.row)"
         ></el-input>
       </template>
@@ -75,6 +76,13 @@
   import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
   import LegalDialog from '@/views/costAudit/baseInfo/catalogManage/legalDialog.vue'
   import { dictMixin } from '@/mixins/useDict'
+  import {
+    // 资料清单相关API
+    getDocumentCatalog,
+    addDocumentCatalog,
+    updateDocumentCatalog,
+    deleteDocumentCatalog,
+  } from '@/api/catalogManage'
   export default {
     components: {
       CostAuditTable,
@@ -236,24 +244,14 @@
           page: currentPage,
           size: pageSize,
         }
-        getCostProjectMaterialPageList(params)
-          .then((res) => {
-            if (res && res.value && res.value.value) {
-              this.materialList = Array.isArray(res.value.value.records)
-                ? res.value.value.records
-                : []
-              this.pagination.total = Number(res.value.value.total) || 0
-            } else {
-              this.materialList = []
-              this.pagination.total = 0
-            }
-          })
-          .catch((error) => {
-            console.error('加载材料数据失败:', error)
-            // 错误时清空数据避免显示异常
-            this.materialList = []
-            this.pagination.total = 0
-          })
+        getDocumentCatalog({
+          catalogId: this.project.catalogId,
+          pageNum: currentPage,
+          pageSize: pageSize,
+        }).then((res) => {
+          this.materialList = res.value.records
+          this.pagination.total = res.value.total
+        })
       },
 
       // 排序变更
@@ -261,9 +259,8 @@
         // 排序逻辑
         let data = {
           ...row,
-          projectId: this.project.projectId,
         }
-        updateCostProjectMaterial(data)
+        updateDocumentCatalog(data)
           .then((res) => {
             this.$message.success('修改成功')
             this.loadMaterialData()
@@ -279,7 +276,7 @@
           formatRequired: '',
           templateId: '',
           surveyTemplateName: '',
-          orderNum: 1,
+          orderNum: this.materialList.length + 1,
           isRequired: '0',
         }
         this.materialDialogVisible = true
@@ -307,7 +304,7 @@
         )
           .then(() => {
             try {
-              deleteCostProjectMaterial(row.id).then((res) => {
+              deleteDocumentCatalog(row.id).then((res) => {
                 this.$message.success('删除成功')
                 this.loadMaterialData()
               })
@@ -324,18 +321,32 @@
       handleMaterialSubmit(formData) {
         let data = {
           ...formData,
-          projectId: this.project.projectId,
+          catalogId: this.project.catalogId,
+          // projectId: this.project.projectId,
+        }
+        if (formData.id) {
+          updateDocumentCatalog(data)
+            .then((res) => {
+              this.$message.success('修改成功')
+              this.$refs.legalDialog.setSubmitting(false)
+              this.materialDialogVisible = false
+              this.loadMaterialData()
+            })
+            .catch(() => {
+              this.$refs.legalDialog.setSubmitting(false)
+            })
+        } else {
+          addDocumentCatalog(data)
+            .then((res) => {
+              this.$message.success('添加成功')
+              this.$refs.legalDialog.setSubmitting(false)
+              this.materialDialogVisible = false
+              this.loadMaterialData()
+            })
+            .catch(() => {
+              this.$refs.legalDialog.setSubmitting(false)
+            })
         }
-        updateCostProjectMaterial(data)
-          .then((res) => {
-            this.$message.success('保存成功')
-            this.$refs.legalDialog.setSubmitting(false)
-            this.materialDialogVisible = false
-            this.loadMaterialData()
-          })
-          .catch(() => {
-            this.$refs.legalDialog.setSubmitting(false)
-          })
       },
       handleLegalSubmit() {},
       handleMaterialCancel() {

+ 35 - 11
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/surveyTab.vue

@@ -6,6 +6,9 @@
       :table-data="surveyData.list"
       :columns="getSurveyColumns()"
       :show-action-column="true"
+      :show-pagination="true"
+      :pagination="costSurveyPagination"
+      @pagination-change="handlePaginationChange"
     ></CostAuditTable>
     <!-- 成本调查表查看弹窗 -->
     <SurveyDialog
@@ -23,6 +26,11 @@
   import SurveyDialog from '@/views/costAudit/baseInfo/catalogManage/surveyDialog.vue'
   // 引入获取调查模板数据的API
   import { getCostSurveyTemplates } from '@/api/catalogManage.js'
+  import {
+    // 成本调查与模板相关API
+    getCostSurveyForms,
+    getallCurrentCostSurveyList,
+  } from '@/api/catalogManage'
   export default {
     components: {
       CostAuditTable,
@@ -59,6 +67,11 @@
         surveyData: {
           list: [],
         },
+        costSurveyPagination: {
+          currentPage: 1,
+          pageSize: 10,
+          total: 0,
+        },
       }
     },
     computed: {
@@ -103,18 +116,29 @@
 
         const params = {
           catalogId: this.project.catalogId,
+          pageNum: this.costSurveyPagination.currentPage,
+          pageSize: this.costSurveyPagination.pageSize,
         }
-        getCostSurveyTemplates(params)
-          .then((res) => {
-            // 尝试多种可能的数据结构
-            if (res && res.value) {
-              this.surveyData.list = Array.isArray(res.value) ? res.value : []
-            }
-          })
-          .catch((error) => {
-            console.error('加载调查模板数据失败:', error)
-            this.surveyData.list = []
-          })
+        getCostSurveyForms(params).then((res) => {
+          this.surveyData.list = res.value.records
+          this.costSurveyPagination.total = res.value.total
+        })
+        // getCostSurveyTemplates(params)
+        //   .then((res) => {
+        //     // 尝试多种可能的数据结构
+        //     if (res && res.value) {
+        //       this.surveyData.list = Array.isArray(res.value) ? res.value : []
+        //     }
+        //   })
+        //   .catch((error) => {
+        //     console.error('加载调查模板数据失败:', error)
+        //     this.surveyData.list = []
+        //   })
+      },
+      handlePaginationChange({ currentPage, pageSize }) {
+        this.costSurveyPagination.currentPage = currentPage
+        this.costSurveyPagination.pageSize = pageSize
+        this.loadSurveyData()
       },
 
       // 获取带操作按钮的表格列配置