Procházet zdrojové kódy

fix:文书新增模板类型和名字字段

luzhixia před 1 týdnem
rodič
revize
649df8d192

+ 5 - 1
src/components/task/mounTaskComponents/index.js

@@ -558,11 +558,15 @@ export const taskMixin = {
       if (!pid) return
       // 编辑态和查看态后台的权限标识不同,未携带会导致列表为空
       const permissionType = this.isView ? '0' : '1'
+      // 确保data是对象,避免当传入非对象类型(如字符串)时出错
+      const documentType =
+        typeof data === 'object' && data !== null ? data.documentType || '' : ''
       getCostProjectDocumentPageList({
         pageNum: this.documentData.pagination.currentPage,
         pageSize: this.documentData.pagination.pageSize,
         projectId: pid,
-        documentName: data ? data.documentName : '',
+        // documentName: data ? data.documentName : '',
+        documentType,
         permissionType,
       }).then((res) => {
         let records = res.value.value.records

+ 14 - 3
src/views/costAudit/auditInfo/auditManage/auditDocumentsMain.vue

@@ -413,6 +413,7 @@
           documentName: '',
           documentNumber: '',
           documentType: '',
+          documentTypeName: '',
           documentWhId: '',
           electronicDocumentUrl: '',
           enterpriseId: [],
@@ -625,11 +626,17 @@
         this.getlist(data)
       },
       getlist(data) {
+        // 确保data是对象,避免当传入非对象类型(如字符串)时出错
+        const documentType =
+          typeof data === 'object' && data !== null
+            ? data.documentType || ''
+            : ''
         getCostProjectDocumentPageList({
           pageNum: this.documentData.pagination.currentPage,
           pageSize: this.documentData.pagination.pageSize,
           projectId: this.project.projectId,
-          documentName: data ? data.documentName : '',
+          // documentName: data ? data.documentName : '',
+          documentType,
           permissionType: '0',
         }).then((res) => {
           let records = res.value.value.records
@@ -815,6 +822,8 @@
         this.isWh = data.isWh
         this.fileUrl = data.fileUrl
         this.document.documentName = data.documentName
+        this.document.documentType = data.documentType || ''
+        this.document.documentTypeName = data.documentTypeName || ''
         this.document.documentNumber = ''
         this.document.documentWhId = ''
       },
@@ -1537,9 +1546,11 @@
     cursor: pointer;
     font-size: 12px;
   }
-
+  .type-item.active {
+    color: $base-color-default;
+  }
   .type-item:hover {
-    color: #409eff;
+    color: $base-color-default;
   }
 
   .documents-content {

+ 40 - 3
src/views/costAudit/baseInfo/auditReviewDocManage/index.vue

@@ -336,6 +336,25 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
+                <el-form-item label="模板类型:" prop="documentType">
+                  <el-select
+                    v-model="formData.documentType"
+                    style="width: 100%"
+                    placeholder="请选择类型"
+                    @change="handleDocumentTypeChange"
+                  >
+                    <el-option
+                      v-for="item in dictData['documentTemplateType']"
+                      :key="item.key"
+                      :label="item.name"
+                      :value="item.key"
+                    ></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-row :gutter="20">
+              <el-col :span="12">
                 <el-form-item label="是否需要文号:" prop="isWh">
                   <el-radio-group v-model="formData.isWh">
                     <el-radio label="0">是</el-radio>
@@ -343,9 +362,7 @@
                   </el-radio-group>
                 </el-form-item>
               </el-col>
-            </el-row>
-            <el-row :gutter="20">
-              <el-col :span="24">
+              <el-col :span="12">
                 <el-form-item label="说明:" prop="description">
                   <el-input
                     v-model="formData.description"
@@ -594,6 +611,7 @@
       return {
         dictData: {
           documentType: [], //文书类型
+          documentTemplateType: [], //文书模板类型
         },
         loading: false,
         // 视图控制
@@ -642,6 +660,9 @@
               trigger: 'blur',
             },
           ],
+          documentType: [
+            { required: true, message: '请选择模板类型', trigger: 'change' },
+          ],
           // dataSourceType: [
           //   { required: true, message: '请选择数据来源', trigger: 'change' },
           // ],
@@ -886,6 +907,20 @@
         }
       },
 
+      // 处理模板类型变化
+      handleDocumentTypeChange(value) {
+        // 根据选中的documentType查找对应的documentTypeName
+        const documentTemplateType = this.dictData['documentTemplateType'] || []
+        const selectedType = documentTemplateType.find(
+          (item) => item.key === value
+        )
+        if (selectedType) {
+          this.formData.documentTypeName = selectedType.name
+        } else {
+          this.formData.documentTypeName = ''
+        }
+      },
+
       // 单个删除按钮点击事件
       async handleDeleteRow(row) {
         this.$confirm('确定要删除该记录吗?', '提示', {
@@ -967,6 +1002,8 @@
           tableId: 1,
           isWh: '1',
           type: '',
+          documentType: '',
+          documentTypeName: '',
         }
         this.uploadedFile = null
         this.selectedFile = null

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

@@ -404,6 +404,7 @@
           documentName: '',
           documentNumber: '',
           documentType: '',
+          documentTypeName: '',
           documentWhId: '',
           electronicDocumentUrl: '',
           enterpriseId: [],
@@ -708,6 +709,8 @@
         this.isWh = data.isWh
         this.fileUrl = data.fileUrl
         this.document.documentName = data.documentName
+        this.document.documentType = data.documentType || ''
+        this.document.documentTypeName = data.documentTypeName || ''
         this.document.documentNumber = ''
         this.document.documentWhId = ''
       },

+ 7 - 1
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/index.js

@@ -558,11 +558,17 @@ export const taskMixin = {
       if (!pid) return
       // 查看/编辑权限类型区分,未传会导致列表为空
       const permissionType = this.isView ? '0' : '1'
+
+      // 确保data是对象,避免当传入非对象类型(如字符串)时出错
+      const documentType =
+        typeof data === 'object' && data !== null ? data.documentType || '' : ''
+
       getCostProjectDocumentPageList({
         pageNum: this.documentData.pagination.currentPage,
         pageSize: this.documentData.pagination.pageSize,
         projectId: pid,
-        documentName: data ? data.documentName : '',
+        // documentName: data ? data.documentName : '',
+        documentType,
         permissionType,
       }).then((res) => {
         let records = res.value.value.records