Prechádzať zdrojové kódy

Merge branches 'master' and 'master' of http://116.204.116.5:3000/zzw/cbjsxt-front-master

shiyanyu 1 mesiac pred
rodič
commit
fbf94e46a0

+ 65 - 53
src/views/costAudit/baseInfo/costFormManage/index.vue

@@ -8,18 +8,7 @@
             <el-cascader
               v-model="searchForm.catalogId"
               :options="catalogListOptions"
-              v-bind="{
-                filterable: true,
-                placeholder: '请选择关联监审项目',
-                style: 'width: 100%',
-                showAllLevels: false,
-                props: {
-                  children: 'children',
-                  checkStrictly: true,
-                  label: 'catalogName',
-                  value: 'id',
-                },
-              }"
+              v-bind="props"
               style="width: 100%"
               clearable
             ></el-cascader>
@@ -182,8 +171,9 @@
           <el-cascader
             v-model="formData.catalogId"
             :options="catalogListOptions"
-            v-bind="catalogProps"
+            v-bind="props"
             style="width: 100%"
+            @change="handleCatalogChange"
           ></el-cascader>
         </template>
         <template #surveyTemplateName>
@@ -203,12 +193,12 @@
           <el-radio v-model="formData.templateType" label="2">固定表</el-radio>
           <el-radio v-model="formData.templateType" label="3">动态表</el-radio>
         </template>
-        <template #storageTable>
+        <!-- <template #storageTable>
           <el-input
             v-model="formData.storageTable"
             placeholder="请输入调查表数据存储库表"
           />
-        </template>
+        </template> -->
         <template #remarks>
           <el-input v-model="formData.remarks" type="textarea"
           placeholder="请输入说明,填写调查表的业务说明、填报指引等内容" type:
@@ -325,6 +315,20 @@
           { value: '0', label: '启用' },
           { value: '1', label: '停用' },
         ],
+        props: {
+          filterable: true,
+          placeholder: '请选择关联监审项目',
+          style: 'width: 100%',
+          showAllLevels: false,
+          props: {
+            multiple: false,
+            children: 'children',
+            checkStrictly: false,
+            label: 'catalogName',
+            value: 'id',
+            emitPath: false,
+          },
+        },
       }
     },
     computed: {
@@ -339,6 +343,7 @@
             props: {
               placeholder: '请选择监审类别',
               style: { width: '100%' },
+              checkStrictly: false,
             },
             options: this.catalogIdOptions,
           },
@@ -365,12 +370,12 @@
             label: '表单样式:',
             slotName: 'templateType',
           },
-          {
-            prop: 'storageTable',
-            label: '调查表数据存储库表:',
-            type: 'input',
-            slotName: 'storageTable',
-          },
+          // {
+          //   prop: 'storageTable',
+          //   label: '调查表数据存储库表:',
+          //   type: 'input',
+          //   slotName: 'storageTable',
+          // },
           {
             prop: 'remarks',
             label: '说明:',
@@ -411,10 +416,10 @@
                 : '动态表'
             },
           },
-          {
-            prop: 'storageTable',
-            label: '调查表数据存储表',
-          },
+          // {
+          //   prop: 'storageTable',
+          //   label: '调查表数据存储表',
+          // },
           {
             prop: 'status',
             label: '状态',
@@ -451,6 +456,16 @@
       this.handleSearch()
     },
     methods: {
+      handleCatalogChange(val) {
+        // 设置表单数据
+        this.$set(this.formData, 'catalogId', val)
+        console.log(this.formData.catalogId)
+        this.$nextTick(() => {
+          if (this.$refs.dataForm && this.$refs.dataForm.$refs.formRef) {
+            this.$refs.dataForm.$refs.formRef.clearValidate('catalogId')
+          }
+        })
+      },
       // 初始化表单选项
       initFormOptions() {
         // 将选项数据同步到表单配置中
@@ -468,10 +483,7 @@
         this.loading = true
 
         const params = {
-          catalogId:
-            this.searchForm.catalogId && this.searchForm.catalogId.length > 0
-              ? this.searchForm.catalogId[this.searchForm.catalogId.length - 1]
-              : '',
+          catalogId: this.searchForm.catalogId,
           status: this.searchForm.status,
           pageNum: this.pagination.currentPage,
           pageSize: this.pagination.pageSize,
@@ -604,38 +616,38 @@
       // 查看详情
       handleViewDetail(row) {
         // 处理级联选择器多选回显数据
-        const result = this.formatRelatedItemsForDisplay({
-          catalogId: {
-            value: row.catalogId,
-            options: this.catalogListOptions,
-            id: 'id',
-            parentId: 'parentId',
-          },
-        })
+        // const result = this.formatRelatedItemsForDisplay({
+        //   catalogId: {
+        //     value: row.catalogId,
+        //     options: this.catalogListOptions,
+        //     id: 'id',
+        //     parentId: 'parentId',
+        //   },
+        // })
         this.dialogVisible = true
         this.dialogTitle = `查看成本调查表`
         this.formData = {
           ...row,
-          catalogId: result.catalogId ? result.catalogId : [],
+          // catalogId: result.catalogId ? result.catalogId : [],
         }
       },
 
       // 修改
       handleEdit(row) {
         // 处理级联选择器多选回显数据
-        const result = this.formatRelatedItemsForDisplay({
-          catalogId: {
-            value: row.catalogId,
-            options: this.catalogListOptions,
-            id: 'id',
-            parentId: 'parentId',
-          },
-        })
+        // const result = this.formatRelatedItemsForDisplay({
+        //   catalogId: {
+        //     value: row.catalogId,
+        //     options: this.catalogListOptions,
+        //     id: 'id',
+        //     parentId: 'parentId',
+        //   },
+        // })
         this.dialogTitle = '修改成本调查表'
         this.isEdit = true
         this.formData = {
           ...row,
-          catalogId: result.catalogId ? result.catalogId : [],
+          // catalogId: result.catalogId ? result.catalogId : [],
         }
         this.dialogVisible = true
       },
@@ -690,7 +702,7 @@
 
       // 启动/停用状态
       handleStatus(row) {
-        const action = row.status === '启用' ? '停用' : '启用'
+        const action = row.status == '0' ? '停用' : '启用'
         this.$confirm(`确认要${action}该数据吗?`, '操作确认', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -700,7 +712,7 @@
             changeCostFormStatus(row.surveyTemplateId)
               .then((res) => {
                 if (res.code === 200) {
-                  this.$message.success(`${action}成功`)
+                  this.$message.success(res.message || `${action}成功`)
                   this.handleSearch()
                 }
               })
@@ -740,12 +752,12 @@
           return
         }
         // 处理级联选择器多选数据
-        const resultData = this.extractLastLevelValues({
-          catalogId: this.formData.catalogId,
-        })
+        // const resultData = this.extractLastLevelValues({
+        //   catalogId: this.formData.catalogId,
+        // })
         const data = {
           ...this.formData,
-          ...resultData,
+          // ...resultData,
         }
 
         this.$refs.dataForm

+ 98 - 22
src/views/costAudit/baseInfo/costFormManage/infoMaintain.vue

@@ -247,15 +247,15 @@
         <div v-if="contentEditForm.templateType === '1'">
           <div class="button-group">
             <el-button
+              v-if="!viewDetail"
               type="primary"
-              :disabled="viewDetail"
               @click="handleAddTableHeader('单记录')"
             >
               添加项目
             </el-button>
             <el-button
+              v-if="!viewDetail"
               type="primary"
-              :disabled="viewDetail"
               @click="handleSaveContent('单记录')"
             >
               保存
@@ -498,15 +498,15 @@
         <div v-if="contentEditForm.templateType === '2'">
           <div class="button-group">
             <el-button
+              v-if="!viewDetail"
               type="primary"
-              :disabled="viewDetail"
               @click="handleAddTableHeader('固定表表头')"
             >
               添加表头
             </el-button>
             <el-button
+              v-if="!viewDetail"
               type="primary"
-              :disabled="viewDetail"
               @click="handleSaveContent('固定表表头')"
             >
               下一步
@@ -765,15 +765,15 @@
           <div>
             <div class="button-group">
               <el-button
+                v-if="!viewDetail"
                 type="primary"
-                :disabled="viewDetail"
                 @click="handleAddTableHeader('固定表项目')"
               >
                 添加项目
               </el-button>
               <el-button
+                v-if="!viewDetail"
                 type="primary"
-                :disabled="viewDetail"
                 @click="handleSaveContent('固定表项目')"
               >
                 保存
@@ -955,15 +955,15 @@
         <div v-if="contentEditForm.templateType === '3'">
           <div class="button-group">
             <el-button
+              v-if="!viewDetail"
               type="primary"
-              :disabled="viewDetail"
               @click="handleAddTableHeader('动态表表头')"
             >
               添加表头
             </el-button>
             <el-button
+              v-if="!viewDetail"
               type="primary"
-              :disabled="viewDetail"
               @click="handleSaveContent('动态表表头')"
             >
               下一步
@@ -1206,15 +1206,15 @@
           <div>
             <div class="button-group">
               <el-button
+                v-if="!viewDetail"
                 type="primary"
-                :disabled="viewDetail"
                 @click="handleAddTableHeader('动态表项目')"
               >
                 添加项目
               </el-button>
               <el-button
+                v-if="!viewDetail"
                 type="primary"
-                :disabled="viewDetail"
                 @click="handleSaveContent('动态表项目')"
               >
                 保存
@@ -1364,11 +1364,11 @@
     <el-dialog
       title="计算公式"
       :visible.sync="calculationFormulaDialogVisible"
-      width="500px"
+      width="30%"
       :before-close="handleDialogClose"
     >
       <!-- 单选按钮组:切换“当前指标项”/“其他模板指标项” -->
-      <el-radio-group v-model="radioType">
+      <el-radio-group v-model="radioType" class="mb20">
         <el-radio label="current">当前指标项</el-radio>
         <el-radio label="other">其他模板指标项</el-radio>
       </el-radio-group>
@@ -1385,15 +1385,16 @@
 
       <!-- 「其他模板指标项」内容区域 -->
       <div v-else class="other-panel">
+        <span>版本号:</span>
         <el-select
           v-model="selectedTemplateId"
-          placeholder="请选择模板"
+          placeholder="请选择版本号"
           @change="handleTemplateChange"
         >
           <el-option
             v-for="(item, index) in templateList"
             :key="index"
-            :label="item.surveyTemplateName"
+            :label="item.versionNo"
             :value="item.pkVal"
           ></el-option>
         </el-select>
@@ -1415,8 +1416,25 @@
               ></el-checkbox>
             </template>
           </el-table-column>
-          <el-table-column prop="code" label="指标编号"></el-table-column>
-          <el-table-column prop="name" label="项目名称"></el-table-column>
+          <el-table-column
+            label="指标编号"
+            prop="cellCode"
+            align="center"
+          ></el-table-column>
+          <!--循环表头 -->
+          <el-table-column
+            v-for="(item, index) in indicatorTableHeaders"
+            :key="index"
+            :label="item.rkey"
+            align="center"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              {{
+                scope.row.fixedValues ? scope.row.fixedValues[item.rkey] : ''
+              }}
+            </template>
+          </el-table-column>
         </el-table>
         <el-input
           v-model="formulaText"
@@ -1463,6 +1481,7 @@
     batchDeleteCostForm,
   } from '@/api/costSurveyTemplateVersion'
   import { getListFixedEnabled } from '@/api/costSurveyTemplate'
+  import { listByCurrentTemplateId } from '@/api/catalogManage.js'
   import {
     getListBySurveyTemplateId,
     getListBySurveyTemplateIdAndVersion,
@@ -1503,6 +1522,7 @@
         templateName: '',
         templateList: [],
         indicatorTableData: [],
+        indicatorTableHeaders: [],
         selectedIndicatorCodes: [],
         selectedIndicatorsPerTemplate: {},
         dialogTitle: '',
@@ -1793,7 +1813,15 @@
         this.handleSearch()
       },
       handleRowClick(row, column, event) {
+        // 只有点击非 checkbox 列才触发
         if (column && column.property !== 'checked') {
+          // 如果没有 cellCode,则不允许选中
+          if (!row.cellCode) {
+            // this.$message.warning('该数据没有指标编号,无法选择')
+            return
+          }
+
+          // 切换选中状态
           this.toggleRowSelection(row)
         }
       },
@@ -1810,6 +1838,12 @@
         this.$forceUpdate()
       },
       handleCheckboxChange(row) {
+        // 如果没有 cellCode,则不允许选中
+        if (!row.cellCode) {
+          this.$message.warning('该数据没有指标编号,无法选择')
+          this.$set(row, 'checked', false)
+          return
+        }
         this.$set(row, 'checked', !row.checked)
 
         if (row.checked) {
@@ -1888,9 +1922,25 @@
       },
 
       getListFixedEnabled() {
-        getListFixedEnabled().then((res) => {
-          this.templateList = res.value
-        })
+        // 修改为调用状态为现行的数据
+        const params = {
+          surveyTemplateId: this.surveyTemplateId,
+          status: '0',
+          // pageNum: this.pagination.currentPage,
+          // pageSize: this.pagination.pageSize,
+        }
+
+        // 根据成本调查表ID获取所有版本数据
+        getCostSurveyTemplateVersionsByTemplateId(params)
+          .then((response) => {
+            this.templateList = response.value || []
+          })
+          .catch((error) => {
+            console.error('查询失败:', error)
+          })
+        // getListFixedEnabled().then((res) => {
+        //   this.templateList = res.value
+        // })
       },
       // 处理模板选择变化
       handleTemplateChange(templateId) {
@@ -1901,7 +1951,33 @@
           )
 
           if (selectedTemplate && selectedTemplate.surveyTemplateId) {
-            this.getCellCodesByTemplateId(selectedTemplate.surveyTemplateId)
+            // this.getCellCodesByTemplateId(selectedTemplate.surveyTemplateId)
+            listByCurrentTemplateId({
+              surveyTemplateId: selectedTemplate.surveyTemplateId,
+            }).then((responseData) => {
+              //解析并显示数据
+              if (responseData.value && responseData.value.itemlist) {
+                const itemList = responseData.value.itemlist
+                let fixedTablesTitle = this.stringToObjects(
+                  responseData.value.fixedFields || ''
+                )
+                this.indicatorTableHeaders = fixedTablesTitle
+                // 遍历itemList,为每个项目创建一行数据
+                itemList.forEach((item, index) => {
+                  const newRow = {
+                    ...item,
+                    checked: false,
+                    cellCode: item.cellCode || '',
+                    fixedValues: {},
+                  }
+                  // 初始化fixedValues并填充实际值
+                  fixedTablesTitle.forEach((title) => {
+                    newRow.fixedValues[title.rkey] = item[title.rkey] || ''
+                  })
+                  this.indicatorTableData.push(newRow)
+                })
+              }
+            })
           } else {
             this.indicatorTableData = []
           }
@@ -3383,7 +3459,7 @@
             delSurveyTemplateVersionById(row.id)
               .then((res) => {
                 if (res.code === 200) {
-                  this.$message.success(res.message)
+                  this.$message.success(res.message || '删除成功')
                   this.handleSearch()
                   this.loading = false
                 }
@@ -3417,7 +3493,7 @@
             batchDeleteCostForm(ids)
               .then((res) => {
                 this.selectedRows = []
-                this.$message.success(res.message)
+                this.$message.success(res.message || '删除成功')
                 this.handleSearch()
                 this.loading = false
               })

+ 75 - 39
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/auditNoticeTab.vue

@@ -8,6 +8,8 @@
           v-for="type in documentData.documentTypes"
           :key="type.id"
           class="type-item"
+          :class="{ active: activeDocumentTypeId === type.id }"
+          @click="handleDocumentTypeClick(type)"
         >
           {{ type.documentName }}
         </div>
@@ -138,10 +140,11 @@
           <el-form
             v-loading="loading.saveDocument"
             :model="document"
-            label-width="160px"
+            label-width="170px"
             size="small"
+            :rules="documentRules"
           >
-            <el-form-item label="选择模板:">
+            <el-form-item label="选择模板:" prop="documentId">
               <el-select
                 v-model="document.documentId"
                 placeholder="请选择模板"
@@ -156,7 +159,7 @@
                 ></el-option>
               </el-select>
             </el-form-item>
-            <el-form-item label="通知书文号:" prop="documentWhId">
+            <el-form-item label="通知书文号:" prop="documentNumber">
               <el-input
                 v-model="document.documentNumber"
                 placeholder="请选择通知书文号"
@@ -172,7 +175,7 @@
                 选择文号
               </el-button>
             </el-form-item>
-            <el-form-item label="被监审单位:">
+            <el-form-item label="被监审单位:" prop="enterpriseId">
               <el-select
                 v-model="document.enterpriseId"
                 placeholder="请选择被监审单位"
@@ -188,9 +191,9 @@
                 ></el-option>
               </el-select>
             </el-form-item>
-            <el-form-item label="是否推送被监审单位:">
+            <el-form-item label="是否推送被监审单位:" prop="isPushed">
               <!-- 是否推送被监审单位 -->
-              <el-radio-group v-model="document.isPush">
+              <el-radio-group v-model="document.isPushed">
                 <el-radio label="1">是</el-radio>
                 <el-radio label="0">否</el-radio>
               </el-radio-group>
@@ -227,24 +230,28 @@
                   label="数据项"
                   width="120"
                   align="center"
+                  show-overflow-tooltip
                 ></el-table-column>
                 <el-table-column
-                  prop="label"
+                  prop="labelValue"
                   label="标签"
                   width="100"
                   align="center"
+                  show-overflow-tooltip
                 ></el-table-column>
                 <el-table-column
                   prop="originalText"
                   label="描述"
                   min-width="120"
-                  align="left"
+                  align="center"
+                  show-overflow-tooltip
                 ></el-table-column>
                 <el-table-column
                   prop="dataValue"
                   label="数据值"
                   min-width="150"
-                  align="left"
+                  align="center"
+                  show-overflow-tooltip
                 ></el-table-column>
               </el-table>
               <div style="margin-top: 10px; font-size: 12px; color: #909399">
@@ -320,13 +327,7 @@
       },
       documentData: {
         type: Object,
-        default: () => ({
-          documentTypes: [],
-          list: [],
-          pagination: {},
-          dataList: [],
-          documentColumns: [],
-        }),
+        default: () => {},
       },
     },
     data() {
@@ -334,12 +335,14 @@
         dictData: {
           whGenerateType: [],
         },
+        activeDocumentTypeId: '',
         document: {
           documentId: '',
           documentWhId: '',
           documentNumber: '',
           enterpriseId: [],
           dataList: [],
+          isPushed: '1',
         },
         loading: {
           saveDocument: false,
@@ -362,6 +365,36 @@
         },
         selectDocumentWhSelection: [],
         costDocumentTemplateFiles: [],
+        documentRules: {
+          documentNumber: [
+            {
+              required: true,
+              message: '请选择通知书文号',
+              trigger: 'change',
+            },
+          ],
+          enterpriseId: [
+            {
+              required: true,
+              message: '请选择被监审单位',
+              trigger: 'change',
+            },
+          ],
+          documentId: [
+            {
+              required: true,
+              message: '请选择模板',
+              trigger: 'change',
+            },
+          ],
+          isPushed: [
+            {
+              required: true,
+              message: '请选择否推送被监审单位',
+              trigger: 'change',
+            },
+          ],
+        },
       }
     },
     computed: {
@@ -405,23 +438,15 @@
         ]
       },
     },
-    // 添加watch监听project变化,确保项目数据更新时重新加载数据
-    watch: {
-      project: {
-        handler(newVal) {
-          if (newVal && newVal.projectId) {
-            // 通知父组件需要加载数据
-            this.$emit('refresh', newVal.projectId)
-          }
-        },
-        deep: true,
-        immediate: true,
-      },
-    },
+    watch: {},
     mounted() {
       this.loadOpts()
     },
     methods: {
+      handleDocumentTypeClick(data) {
+        this.activeDocumentTypeId = data.id
+        this.$emit('refresh', data)
+      },
       getEnterpriseName(row) {
         // 处理enterpriseId,无论是数组还是逗号分隔的字符串
         let enterpriseIds = []
@@ -477,6 +502,10 @@
           documentWhId: '',
           documentNumber: '',
           enterpriseId: [],
+          isPushed: '1', // 默认设置为'1'(是)
+        }
+        if (this.activeDocumentTypeId) {
+          this.document.documentId = this.activeDocumentTypeId
         }
         this.costProjectDocumentFiles = []
       },
@@ -507,10 +536,6 @@
           this.selectDocumentWhSelection = selection
         }
       },
-      // 选择文档类型
-      selectDocumentType(doc) {
-        // this.documentData.selectedDoc = doc.value
-      },
       handleTemplateChange() {
         this.fileUrl = this.documentData.documentTypes.find(
           (item) => item.id === this.document.documentId
@@ -566,8 +591,8 @@
             documentId: this.document.documentId,
             documentNumber: this.document.documentNumber,
             documentWhId: this.document.documentWhId,
-            costProjectDocumentFiles: this.costProjectDocumentFiles || [],
-            // isPushed: this.document.isPushed,
+            costProjectDocumentFiles: this.costDocumentTemplateFiles,
+            isPushed: this.document.isPushed, // 添加isPushed字段
             projectId: this.project.projectId,
             // electronicDocumentUrl: '',
             enterpriseId: this.document.enterpriseId.join(','), // 保存时转换为逗号分隔的字符串
@@ -594,13 +619,13 @@
               documentId: this.document.documentId,
               documentNumber: this.document.documentNumber,
               documentWhId: this.document.documentWhId,
-              costProjectDocumentFiles: this.costProjectDocumentFiles || [],
+              costProjectDocumentFiles: this.costDocumentTemplateFiles || [],
               enterpriseId: enterpriseId,
               // electronicDocumentUrl: '',
               // feedbackDocumentUrl: '',
               // feedbackTime: '',
               // generateTime: '',
-              isPushed: this.document.isPushed,
+              isPushed: this.document.isPushed, // 使用isPushed,如果不存在则使用isPushed
               // orderNum: 0,
               // pushTime: '',
               // scanDocumentUrl: '',
@@ -611,7 +636,7 @@
             .then(() => {
               this.loading.saveDocument = false
               this.$message.success('保存成功!')
-              this.dialogVisible = false
+              this.documentDialogVisible = false
               this.activeView = ''
               this.$emit('refresh', this.project.projectId)
             })
@@ -746,8 +771,15 @@
           : []
         this.document = {
           ...row,
+          documentId: Number(row.documentId),
           enterpriseId,
+          // 确保isPushed有值,如果row中没有,设置默认值'1'
+          isPushed: row.isPushed !== undefined ? row.isPushed : '1',
         }
+        this.fileUrl = this.documentData.documentTypes.find(
+          (item) => item.id === this.document.documentId
+        ).fileUrl
+        this.getDocumentData(this.document.documentId)
       },
 
       // 签章
@@ -800,7 +832,11 @@
   }
 
   .type-item:hover {
-    color: #409eff;
+    color: $base-color-default;
+  }
+
+  .type-item.active {
+    color: $base-color-default;
   }
 
   .documents-content {

+ 42 - 36
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/index.js

@@ -217,7 +217,7 @@ export const taskMixin = {
         },
         surveyColumns: [
           {
-            prop: 'surveyTemplateId',
+            prop: 'surveyTemplateName',
             label: '成本调查表',
             minWidth: 200,
             align: 'left',
@@ -240,14 +240,6 @@ export const taskMixin = {
             label: '操作',
             width: 120,
             align: 'center',
-            actions: [
-              {
-                name: 'view',
-                label: '查看模板',
-                type: 'text',
-                onClick: this.handleViewTemplate,
-              },
-            ],
           },
         ],
       },
@@ -429,18 +421,16 @@ export const taskMixin = {
     }
   },
   computed: {},
-  methods: {
-    // 获取用户信息
-    getUser() {
-      getAllUserList()
-        .then((res) => {
-          this.userList = res.value || []
-        })
-        .catch(() => {})
+  watch: {
+    activeTab: {
+      handler(newVal) {
+        this.handleTabClick()
+      },
+      immediate: false, // 可选:如果需要在组件初始化时就执行,可以设置为true
     },
-    // 标签页切换
-    handleTabClick(tab) {
-      // 可添加标签页切换时的逻辑
+  },
+  methods: {
+    async handleTabClick() {
       switch (this.activeTab) {
         case 'basicInfo':
           this.getBasicInfo()
@@ -455,6 +445,8 @@ export const taskMixin = {
           this.getSurveyData()
           break
         case 'auditNotice':
+          const res = await getWhCateList()
+          this.documentData.documentTypes = res.value || []
           this.getDocumentData()
           break
         case 'workflow':
@@ -464,15 +456,27 @@ export const taskMixin = {
           break
       }
     },
+    // 获取用户信息
+    getUser() {
+      getAllUserList()
+        .then((res) => {
+          this.userList = res.value || []
+        })
+        .catch(() => {})
+    },
     getBasicInfo() {
       getCostProjectDetail({
         id: this.project.projectId,
-      }).then((res) => {
-        this.formData.basicInfo = {
-          ...this.project,
-          ...res.value,
-        }
       })
+        .then((res) => {
+          this.formData.basicInfo = {
+            ...this.project,
+            ...res.value,
+          }
+        })
+        .catch(() => {
+          this.formData.basicInfo = this.project
+        })
     },
     // 获取监审工作方案数据
     getScenarioData() {
@@ -495,31 +499,33 @@ export const taskMixin = {
         pageSize: this.materialData.pagination.pageSize,
         projectId: this.project.projectId,
       }).then((res) => {
-        if (res.code == 200) {
-          this.materialData.list = res.value.value.records
+        if (res.value.code == 200) {
+          this.materialData.list = res.value.value.records || []
           this.materialData.pagination.total = res.value.value.total
+        } else {
+          this.materialData.list = []
+          this.materialData.pagination.total = 0
         }
       })
     },
     // 获取成本调查表数据
     getSurveyData() {
-      getCostProjectSurveyPageList({
-        pageNum: this.surveyData.pagination.currentPage,
-        pageSize: this.surveyData.pagination.pageSize,
-        projectId: this.project.projectId,
+      getCostSurveyTemplates({
+        // pageNum: this.surveyData.pagination.currentPage,
+        // pageSize: this.surveyData.pagination.pageSize,
+        catalogId: this.project.catalogId,
       }).then((res) => {
-        this.surveyData.survey = res.value.records
-        this.surveyData.pagination.total = res.value.total
+        this.surveyData.list = res.value
+        // this.surveyData.pagination.total = res.value.total
       })
     },
     // 获取监审通知数据
-    async getDocumentData() {
-      const res = await getWhCateList()
-      this.documentData.documentTypes = res.value || []
+    async getDocumentData(data) {
       getCostProjectDocumentPageList({
         pageNum: this.documentData.pagination.currentPage,
         pageSize: this.documentData.pagination.pageSize,
         projectId: this.project.projectId,
+        documentName: data ? data.documentName : '',
       }).then((res) => {
         this.documentData.list = res.value.value.records
         this.documentData.pagination.total = res.value.value.total

+ 49 - 23
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/materialTab.vue

@@ -42,7 +42,6 @@
   </div>
 </template>
 <script>
-  import { taskMixin } from './index.js'
   import {
     addCostProjectMaterial,
     updateCostProjectMaterial,
@@ -55,7 +54,6 @@
       CostAuditTable,
       LegalDialog,
     },
-    mixins: [taskMixin],
     props: {
       // 父组件传递的参数
       project: {
@@ -66,6 +64,10 @@
         type: Boolean,
         default: false,
       },
+      materialData: {
+        type: Object,
+        default: () => {},
+      },
     },
     data() {
       return {
@@ -88,19 +90,20 @@
             align: 'center',
           },
         ],
+        formData: {
+          material: {},
+        },
       }
     },
     watch: {
-      // 监听project变化,当项目信息更新时重新获取材料数据
-      // project: {
-      //   handler(newVal) {
-      //     if (newVal && newVal.projectId) {
-      //       this.getMaterialData()
-      //     }
-      //   },
-      //   deep: true,
-      //   immediate: true
-      // }
+      materialData: {
+        handler(val) {
+          if (val) {
+            this.formData.material = val.material
+          }
+        },
+        deep: true,
+      },
     },
     mounted() {},
     methods: {
@@ -114,7 +117,7 @@
         updateCostProjectMaterial(data)
           .then((res) => {
             this.$message.success('修改成功')
-            this.getMaterialData()
+            this.$emit('refresh')
           })
           .catch(() => {})
       },
@@ -130,15 +133,24 @@
           orderNum: 1,
           isRequired: '0',
         }
-        this.materialData.addMaterial = true
-        this.materialData.materialDialogVisible = true
+        // 通知父组件更新状态
+        this.$emit('update:materialData', {
+          ...this.materialData,
+          addMaterial: true,
+          materialDialogVisible: true,
+          materialDialogTitle: '添加',
+        })
       },
 
       // 编辑材料
       handleEditMaterial(row) {
-        this.materialData.materialDialogTitle = '修改'
         this.formData.material = { ...row }
-        this.materialData.materialDialogVisible = true
+        // 通知父组件更新状态
+        this.$emit('update:materialData', {
+          ...this.materialData,
+          materialDialogTitle: '修改',
+          materialDialogVisible: true,
+        })
       },
 
       // 删除材料
@@ -156,7 +168,7 @@
             try {
               deleteCostProjectMaterial(row.id).then((res) => {
                 this.$message.success('删除成功')
-                this.getMaterialData()
+                this.$emit('refresh')
               })
             } catch (error) {
               console.error('删除失败:', error)
@@ -177,24 +189,38 @@
           addCostProjectMaterial(data).then((res) => {
             this.$message.success('添加成功')
             this.$refs.legalDialog.setSubmitting(false)
-            this.materialData.materialDialogVisible = false
-            this.getMaterialData()
+            // 通知父组件关闭弹窗并刷新数据
+            this.$emit('update:materialData', {
+              ...this.materialData,
+              materialDialogVisible: false,
+            })
+            this.$emit('refresh')
           })
         } else {
           updateCostProjectMaterial(data).then((res) => {
             this.$message.success('修改成功')
             this.$refs.legalDialog.setSubmitting(false)
-            this.materialData.materialDialogVisible = false
-            this.getMaterialData()
+            // 通知父组件关闭弹窗并刷新数据
+            this.$emit('update:materialData', {
+              ...this.materialData,
+              materialDialogVisible: false,
+            })
+            this.$emit('refresh')
           })
         }
       },
       handleLegalSubmit() {},
       handleMaterialCancel() {
-        this.materialData.materialDialogVisible = false
+        this.$emit('update:materialData', {
+          ...this.materialData,
+          materialDialogVisible: false,
+        })
       },
       getTemplateOptions() {},
       templatePaginationChange() {},
+      handlePaginationChange({ currentPage, pageSize }) {
+        this.$emit('paginationChange', { currentPage, pageSize })
+      },
     },
   }
 </script>

+ 31 - 5
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/surveyTab.vue

@@ -2,7 +2,7 @@
   <div>
     <CostAuditTable
       :table-data="surveyData.list"
-      :columns="surveyData.surveyColumns"
+      :columns="getSurveyColumns()"
       :show-index="true"
       :show-action-column="true"
     ></CostAuditTable>
@@ -17,7 +17,6 @@
   </div>
 </template>
 <script>
-  import { taskMixin } from './index.js'
   import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
   import SurveyDialog from '@/views/costAudit/baseInfo/catalogManage/surveyDialog.vue'
   export default {
@@ -25,7 +24,6 @@
       CostAuditTable,
       SurveyDialog,
     },
-    mixins: [taskMixin],
     props: {
       // 父组件传递的参数
       project: {
@@ -36,6 +34,10 @@
         type: Boolean,
         default: false,
       },
+      surveyData: {
+        type: Object,
+        default: () => {},
+      },
     },
     data() {
       return {
@@ -55,16 +57,40 @@
         },
       }
     },
-    mounted() {},
+    mounted() {
+      // this.getSurveyData()
+    },
 
     methods: {
+      // 获取带操作按钮的表格列配置
+      getSurveyColumns() {
+        const columns = JSON.parse(
+          JSON.stringify(this.surveyData.surveyColumns || [])
+        )
+        const actionColumn = columns.find((col) => col.prop === 'action')
+        if (actionColumn) {
+          actionColumn.actions = [
+            {
+              name: 'view',
+              label: '查看模板',
+              type: 'text',
+              onClick: this.handleViewTemplate,
+            },
+          ]
+        }
+        return columns
+      },
       // 查看成本调查表内容弹窗
       handleViewTemplate(data) {
         // 设置表单数据
         this.contentEditForm = {
           surveyTemplateName: data.surveyTemplateName || '',
           templateType: data.templateType || '',
-          data: data || {},
+          data:
+            {
+              ...data,
+              surveyId: data.surveyTemplateId,
+            } || {},
         }
         // 设置弹窗标题
         this.contentEditDialogTitle = '查看'

+ 3 - 0
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/tabs.vue

@@ -126,6 +126,9 @@
             :project="project"
             :is-view="isView"
             :material-data="materialData"
+            @refresh="getMaterialData"
+            @paginationChange="handlePaginationChange"
+            @update:materialData="(val) => (materialData = val)"
           ></materialTab>
         </el-tab-pane>
 

+ 12 - 8
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/workflowTab.vue

@@ -40,12 +40,8 @@
       :show-action-column="true"
     >
       <template #action="{ row }">
-        <el-button
-          v-if="row.nodeType == 1"
-          type="text"
-          :disabled="isView"
-          @click="handleSetStep(row)"
-        >
+        <!-- v-if="row.nodeType == 1" -->
+        <el-button type="text" :disabled="isView" @click="handleSetStep(row)">
           设置
         </el-button>
       </template>
@@ -200,6 +196,7 @@
             default-first-option
             placeholder="请选择主办人员"
             style="width: 100%"
+            :disabled="formData.currentStep.nodeType == 0"
           >
             <el-option
               v-for="item in formatterMainUserList()"
@@ -218,7 +215,10 @@
             default-first-option
             placeholder="请选择从办人员"
             style="width: 100%"
-            :disabled="!formData.currentStep.mainUserId"
+            :disabled="
+              !formData.currentStep.mainUserId ||
+              formData.currentStep.nodeType == 0
+            "
           >
             <el-option
               v-for="item in formatterUserList(formData.currentStep.mainUserId)"
@@ -237,6 +237,7 @@
             default-first-option
             placeholder="请选择预置流转操作"
             style="width: 100%"
+            :disabled="formData.currentStep.nodeType == 0"
           >
             <el-option
               v-for="item in dictData['processStatus']"
@@ -255,6 +256,7 @@
             value-format="yyyy-MM-dd"
             style="width: 100%"
             :disabled="isTimePickerDisabled"
+            :picker-options="getPickerOptions(formData.currentStep)"
           ></el-date-picker>
         </el-form-item>
       </el-form>
@@ -372,7 +374,9 @@
         deep: true,
       },
     },
-    mounted() {},
+    mounted() {
+      this.getWorkflow()
+    },
 
     methods: {
       formatterUserList(userId) {