Procházet zdrojové kódy

fix:修改财务报表报表年份异常问题

lazy před 5 měsíci
rodič
revize
b4e4f036f5

+ 8 - 7
src/views/dataSource/financialStatement/components/AddContent.vue

@@ -39,11 +39,7 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item
-        label="报表年份"
-        prop="reportYear"
-        v-if="ruleForm.reportType === 'approvalTable'"
-      >
+      <el-form-item label="报表年份" prop="reportYear">
         <el-date-picker
           v-model="ruleForm.reportYear"
           type="year"
@@ -60,8 +56,8 @@
         <el-date-picker
           v-model="ruleForm.reportMonth"
           type="month"
-          format="YYYY-MM"
-          value-format="YYYY-MM"
+          format="MM"
+          value-format="MM"
           placeholder="请选择报表月份"
         />
       </el-form-item>
@@ -362,6 +358,9 @@
       if (editRowId.value) {
         params.id = editRowId.value
       }
+      if (ruleForm.value.reportType === 'approvalTable') {
+        delete params.reportMonth
+      }
       // 校验资产负债表的必填项
       if (ruleForm.value.reportName == 0) {
         if (!validateAssetsTable()) {
@@ -539,6 +538,8 @@
           if (el == 'reportMonth') {
             ruleForm.value[el] =
               res.data[el] < 10 ? `0${res.data[el]}` : res.data[el]
+          } else if (el == 'reportYear') {
+            ruleForm.value[el] = `${res.data[el]}`
           } else {
             ruleForm.value[el] = res.data[el]
           }