shiyanyu 3 týždňov pred
rodič
commit
be3f7607e9

+ 2 - 1
src/components/task/components/submitData.vue

@@ -23,7 +23,8 @@
           prop="informationName"
           label="报送资料"
           min-width="200"
-          align="center"
+          header-align="center"
+          align="left"
         />
 
         <el-table-column label="资料类型" width="200" align="center">

+ 6 - 0
src/components/task/taskComponents/materialTab.vue

@@ -17,6 +17,8 @@
         <el-table-column
           prop="informationName"
           label="报送资料"
+          header-align="center"
+          align="left"
           min-width="200"
         />
         <el-table-column
@@ -112,6 +114,8 @@
         <el-table-column
           prop="informationName"
           label="报送资料"
+          header-align="center"
+          align="left"
           min-width="200"
         />
         <el-table-column
@@ -207,6 +211,8 @@
         <el-table-column
           prop="informationName"
           label="报送资料"
+          header-align="center"
+          align="left"
           min-width="200"
         />
         <el-table-column

+ 2 - 1
src/components/task/taskInfo.vue

@@ -442,7 +442,8 @@
                 prop="informationName"
                 label="报送资料"
                 min-width="280"
-                align="center"
+                header-align="center"
+                align="left"
               >
                 <template slot-scope="scope">
                   <div

+ 46 - 3
src/utils/request.js

@@ -19,6 +19,43 @@ import { isArray } from '@/utils/validate'
 
 let loadingInstance
 
+// ensure custom style for scrollable error message box exists
+const ensureScrollableBoxStyle = () => {
+  if (typeof document === 'undefined') return
+  const STYLE_ID = 'scrollable-error-box-style'
+  if (document.getElementById(STYLE_ID)) return
+  const style = document.createElement('style')
+  style.id = STYLE_ID
+  style.type = 'text/css'
+  style.textContent = `
+  .scrollable-error-box .el-message-box {
+    /* 不设置固定或全局宽度,仅保留最小可读宽度 */
+    min-width: 70vw;
+    max-height: 80vh;
+  }
+  .scrollable-error-box .el-message-box__header {
+    padding-right: 16px;
+    border-bottom: none;
+  }
+  .scrollable-error-box .el-message-box__content {
+    padding: 14px 16px;
+  }
+  .scrollable-error-box .scrollable-error-content {
+    max-height: 70vh;
+    overflow: auto;
+    white-space: normal;
+    word-break: break-word;
+    line-height: 1.6;
+    font-size: 13px;
+  }
+  .scrollable-error-box .el-message-box__btns {
+    border-top: none;
+    padding: 10px 16px;
+  }
+  `
+  document.head && document.head.appendChild(style)
+}
+
 /**
  * 处理code异常
  * @param {*} code
@@ -27,8 +64,9 @@ let loadingInstance
 const handleCode = (code, msg) => {
   switch (code) {
     case invalidCode:
+      ensureScrollableBoxStyle()
       MessageBox.alert(
-        `<div style="max-height:60vh;overflow:auto">${
+        `<div class="scrollable-error-content">${
           msg || `后端接口${code}异常`
         }</div>`,
         '错误',
@@ -36,6 +74,8 @@ const handleCode = (code, msg) => {
           type: 'error',
           dangerouslyUseHTMLString: true,
           showClose: true,
+          customClass: 'scrollable-error-box',
+          center: false,
         }
       )
       store.dispatch('user/resetAccessToken')
@@ -74,9 +114,10 @@ const handleCode = (code, msg) => {
         // 500 保持原来的轻提示样式
         Vue.prototype.$baseMessage(msg || `后端接口${code}异常`, 'error')
       } else if (Number(code) === 250) {
-        // 250 使用现在的可滚动模态框
+        // 250 使用可滚动模态框(自定义宽度与滚动区域)
+        ensureScrollableBoxStyle()
         MessageBox.alert(
-          `<div style="max-height:60vh;overflow:auto">${
+          `<div class="scrollable-error-content">${
             msg || `后端接口${code}异常`
           }</div>`,
           '错误',
@@ -84,6 +125,8 @@ const handleCode = (code, msg) => {
             type: 'error',
             dangerouslyUseHTMLString: true,
             showClose: true,
+            customClass: 'scrollable-error-box',
+            center: false,
           }
         )
       } else {

+ 2 - 1
src/views/EntDeclaration/auditTaskManagement/components/DataRequirementsTab.vue

@@ -106,7 +106,8 @@
         prop="informationName"
         label="报送资料"
         min-width="280"
-        align="center"
+        header-align="center"
+        align="left"
       >
         <template slot-scope="scope">
           <div v-if="scope.row.isCategoryHeader" class="category-header-cell">

+ 48 - 5
src/views/EntDeclaration/auditTaskManagement/taskFillIn.vue

@@ -77,7 +77,11 @@
 
           <!-- 报送资料 -->
           <el-tab-pane
-            v-if="currentNode === 'clcs' || currentNode === 'tjcl'"
+            v-if="
+              currentNode !== 'jtsy' ||
+              currentNode !== 'cjbg' ||
+              currentNode !== 'gd'
+            "
             label="报送资料"
             name="dataRequirements"
           >
@@ -166,10 +170,10 @@
         <el-form
           ref="materialForm"
           :model="materialForm"
-          :rules="materialRules"
+          :rules="materialRulesComputed"
           label-width="100px"
         >
-          <el-form-item label="资料类别" prop="informationType">
+          <el-form-item v-if="isClcs" label="资料类别" prop="informationType">
             <el-select
               v-model="materialForm.informationType"
               placeholder="请选择资料类别"
@@ -194,7 +198,11 @@
               :disabled="isViewMode"
             ></el-input>
           </el-form-item>
-          <el-form-item label="资料要求:" prop="informationRequire">
+          <el-form-item
+            v-if="isClcs"
+            label="资料要求:"
+            prop="informationRequire"
+          >
             <el-input
               v-model="materialForm.informationRequire"
               placeholder="请输入资料要求"
@@ -203,7 +211,7 @@
               show-word-limit
             ></el-input>
           </el-form-item>
-          <el-form-item label="格式要求:" prop="formatRequired">
+          <el-form-item v-if="isClcs" label="格式要求:" prop="formatRequired">
             <el-select
               v-model="materialForm.formatRequired"
               placeholder="请选择格式要求"
@@ -749,6 +757,40 @@
       }
     },
     computed: {
+      // 是否为材料处理初审阶段
+      isClcs() {
+        return this.currentNode === 'clcs'
+      },
+      // 补充材料校验规则:clcs 阶段严格,其它阶段仅名称必填
+      materialRulesComputed() {
+        const fileRequiredRule = {
+          validator: (rule, value, callback) => {
+            const hasFile =
+              (this.materialForm.fileList &&
+                this.materialForm.fileList.length > 0) ||
+              (this.materialForm.fileUrl &&
+                String(this.materialForm.fileUrl).trim() !== '')
+            if (!hasFile) return callback(new Error('请上传附件'))
+            callback()
+          },
+          trigger: 'change',
+        }
+
+        if (this.currentNode === 'clcs') {
+          // 基于原有规则补充“上传附件必填”
+          return {
+            ...this.materialRules,
+            fileList: [fileRequiredRule],
+          }
+        }
+        // 其它节点:仅资料名称必填 + 上传附件必填
+        return {
+          informationName: [
+            { required: true, message: '请输入资料名称', trigger: 'blur' },
+          ],
+          fileList: [fileRequiredRule],
+        }
+      },
       // 是否选择了“预置模版”格式(通过名称或key含义判断,兼容后端字典差异)
       isTemplateFormat() {
         const raw = this.materialForm.formatRequired
@@ -1846,6 +1888,7 @@
               formatRequired: this.materialForm.formatRequired,
               fileUrl: this.materialForm.fileUrl,
               templateId: this.materialForm.templateId,
+              taskNode: this.localTaskInfo.currentNode,
             })
               .then((res) => {
                 // console.log('补充材料提交成功', res)

+ 4 - 1
src/views/EntDeclaration/auditTaskProcessing/index.vue

@@ -201,7 +201,10 @@
           </el-button>
           <el-button
             v-if="
-              scope.row.status === '600' && scope.row.currentNode !== 'jtsy'
+              (scope.row.status === 600 || scope.row.status === '600') &&
+              (scope.row.currentNode !== 'jtsy' ||
+                scope.row.currentNode !== 'cjbg' ||
+                scope.row.currentNode !== 'gd')
             "
             size="mini"
             type="text"

+ 42 - 44
src/views/costAudit/auditInfo/auditManage/costAudit.vue

@@ -5,7 +5,7 @@
         ref="auditForm"
         :model="auditForm"
         :rules="rules"
-        :disabled="auditForm.surveyTemplateId !== ''"
+        :disabled="hasTableData"
       >
         <el-row :gutter="20">
           <el-col :span="6">
@@ -65,7 +65,7 @@
         </el-row>
       </el-form>
       <el-button
-        v-if="!hasUploadData"
+        v-if="!hasTableData"
         type="primary"
         size="small"
         :loading="loading"
@@ -398,6 +398,11 @@
           : []
         return cols.filter((c) => c && c.showVisible !== '0')
       },
+      hasTableData() {
+        return (
+          Array.isArray(this.costAuditData) && this.costAuditData.length > 0
+        )
+      },
     },
     watch: {
       // 直接监听最终的模板ID:一旦有值(或变更),拉取最新版本数据回显
@@ -1872,47 +1877,29 @@
       },
       handleDeleteItem(row) {
         // 显示确认对话框
-        this.$confirm(
-          '确定要删除此行数据吗?如果删除的是父项,将同时删除其所有子项。',
-          '确认删除',
-          {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning',
-          }
-        )
+        this.$confirm('确定要删除此行数据吗?', '确认删除', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
           .then(() => {
-            // 获取要删除的行ID
-            const rowId = row.rowId || row.id
-            // 收集要删除的行索引
-            const indicesToDelete = []
-
-            // 查找要删除的行及其子项
-            for (let i = 0; i < this.costAuditData.length; i++) {
-              const item = this.costAuditData[i]
-              // 如果是要删除的行本身,或者是其子项
-              if (
-                item.rowId === rowId ||
-                item.id === rowId ||
-                (item.parentId !== '-1' &&
-                  (item.parentId === rowId || item.parentId === row.id))
-              ) {
-                indicesToDelete.push(i)
-              }
+            // 仅删除当前这一行
+            const targetId =
+              (row && (row.rowid || row.rowId || row.id || row.itemId)) || null
+            const index = this.costAuditData.findIndex((it) => {
+              if (it === row) return true
+              const itId = it && (it.rowid || it.rowId || it.id || it.itemId)
+              return targetId != null && itId === targetId
+            })
+            if (index !== -1) {
+              this.costAuditData.splice(index, 1)
             }
 
-            // 从后往前删除,避免索引偏移
-            indicesToDelete
-              .sort((a, b) => b - a)
-              .forEach((index) => {
-                this.costAuditData.splice(index, 1)
-              })
-
             // 更新剩余行的orderNum
             this.updateOrderNumbersAfterDelete(row)
 
             // 删除行后调用保存模板方法
-            this.handleSaveTemplate('delete')
+            // this.handleSaveTemplate('delete')
 
             this.$message.success('行删除成功')
           })
@@ -1923,18 +1910,19 @@
       },
       // 删除行后更新orderNum的方法
       updateOrderNumbersAfterDelete(deletedRow) {
-        const deletedOrderNum = deletedRow.orderNum
-        const deletedParentId = deletedRow.parentId || '-1'
+        const deletedOrderNum = deletedRow && deletedRow.orderNum
+        const deletedParentId =
+          (deletedRow && (deletedRow.parentId || deletedRow.parentid)) || '-1'
 
-        // 遍历所有行,更新orderNum
+        // 遍历所有行,更新orderNum(同父级范围内顺延)
         this.costAuditData.forEach((item) => {
-          // 如果是相同父项的子项,或者都是父项(parentId为'-1'),且orderNum大于删除行的orderNum
+          const parentId = item.parentId || item.parentid || '-1'
           if (
-            (item.parentId === deletedParentId ||
-              (item.parentId === '-1' && deletedParentId === '-1')) &&
+            parentId === deletedParentId &&
+            typeof item.orderNum !== 'undefined' &&
+            typeof deletedOrderNum !== 'undefined' &&
             item.orderNum > deletedOrderNum
           ) {
-            // 将orderNum减1,保持连续性
             item.orderNum -= 1
           }
         })
@@ -2035,7 +2023,17 @@
         if (ch === '-' || ch === '+') {
           const prop = cfg && cfg.prop
           const val = String((prop && row[prop]) || '')
-          if (val.length > 0) e.preventDefault()
+          const el = e.target
+          // 允许在开头输入正负号:
+          // 1) 若当前值为空,允许
+          // 2) 若光标在起始位置且当前无前导正负号,允许
+          if (
+            val.length === 0 ||
+            (el && el.selectionStart === 0 && !/^[-+]/.test(val))
+          ) {
+            return
+          }
+          e.preventDefault()
           return
         }
         e.preventDefault()

+ 2 - 1
src/views/costAudit/auditInfo/auditManage/submitData.vue

@@ -23,7 +23,8 @@
           prop="informationName"
           label="报送资料"
           min-width="200"
-          align="center"
+          header-align="center"
+          align="left"
         />
 
         <el-table-column label="资料类型" width="200" align="center">

+ 9 - 9
src/views/costAudit/projectInfo/auditTaskManage/taskProgressManage/index.vue

@@ -81,14 +81,6 @@
               v-if="row.status != 400 && row.status != 300"
               size="mini"
               type="text"
-              @click="handlePause(row)"
-            >
-              中止
-            </el-button>
-            <el-button
-              v-if="row.status != 400 && row.status != 300"
-              size="mini"
-              type="text"
               @click="handleUrgeReporting(row)"
             >
               催报
@@ -106,6 +98,14 @@
               v-if="row.status != 400 && row.status != 300"
               size="mini"
               type="text"
+              @click="handlePause(row)"
+            >
+              中止
+            </el-button>
+            <el-button
+              v-if="row.status != 400 && row.status != 300"
+              size="mini"
+              type="text"
               @click="handleDelegate(row)"
             >
               催办
@@ -475,7 +475,7 @@
           {
             prop: 'action',
             label: '操作',
-            width: 220,
+            width: 260,
             align: 'center',
             slotName: 'action',
           },