浏览代码

1.机器设备测算页面调整

GouGengquan 7 月之前
父节点
当前提交
9ad8a316a4

+ 34 - 46
src/views/assets/folder/child.vue

@@ -16,13 +16,13 @@
       </div>
     </div>
     <div class="example-list report-div">
-      <el-card class="report-item no-border" shadow="never" v-for="item in calculateList">
+      <el-card class="report-item no-border" shadow="never" v-for="item in calculateList" @click="doCalculateBench(item)">
         <div class="report-icon">
-          <img src="../../../assets/icons/word.png" style="width: 52px; height: 52px;" />
+          <img src="../../../assets/icons/excel.png" style="width: 52px; height: 52px;" />
         </div>
         <div class="report-text">
-          <!-- <span class="report-text-type">{{ item. }}</span>
-          <span> 一 </span> -->
+          <span class="report-text-type">{{ item.projectTypeName }}</span>
+          <span> 一 </span>
           <span class="report-text-name">{{ item.calculateName }}
           </span>
           <div style="margin-top: 5px;">
@@ -31,51 +31,17 @@
                 <Avatar />
               </el-icon>
               {{ item.principal }}</span>
-            <span>
+            <!-- <span>
               <el-tag style="margin-left: 5px;">
                 {{ item.projectTypeName }}
               </el-tag>
-            </span>
+            </span> -->
             <span style="float: right; color:darkgrey">
               {{ item.createTime }}
             </span>
           </div>
         </div>
-        <div class="report-button">
-          <el-icon>
-            <Download />
-          </el-icon>
-        </div>
-      </el-card>
-      <el-card class="report-item no-border" shadow="never">
-        <div class="report-icon">
-          <img src="../../../assets/icons/excel.png" style="width: 52px; height: 52px;" />
-        </div>
-        <div class="report-text">
-          <span class="report-text-type">资产债权类测算表</span>
-          <span> 一 </span>
-          <span class="report-text-name">遂宁市船山区五彩缤纷路132号134号 136号等船山区慈音路2号南瑞弗莱明戈 10栋2层1商业债权评估明细表
-          </span>
-          <div style="margin-top: 5px;">
-            <span>
-              <el-icon>
-                <Avatar />
-              </el-icon>
-              恒丰银行成都分行</span>
-            <span>
-              <el-tag style="margin-left: 5px;">
-                债权
-              </el-tag>
-              <el-tag style="margin-left: 5px;" type="danger">
-                评估
-              </el-tag>
-            </span>
-            <span style="float: right; color:darkgrey">
-              2024-10-16 12:10:09
-            </span>
-          </div>
-        </div>
-        <div class="report-button">
+        <div class="report-button" @click.stop="downloadFile(item.docUrl, item.docName)">
           <el-icon>
             <Download />
           </el-icon>
@@ -89,6 +55,7 @@
 import { mapStores } from 'pinia'
 import { assetsProjectInfo } from '@/stores/assetsProjectStore';
 import { getUnFinishedCalculateProgress, listAllByProjectId } from '@/api/assetsCalculate';
+import fileUtil from '@/utils/file'
 
 export default {
   name: 'assetsChild',
@@ -119,12 +86,10 @@ export default {
       getUnFinishedCalculateProgress(this.projectStore.projectInfo.id).then(res => {
         if (res.data) {
           // 根据不同进度跳转到不同步骤页面
-          if (res.data.progress === 'GENERATE') {
+          if (res.data.progress === 'IMPORT' || res.data.progress === 'GENERATE' || res.data.progress === 'FINISHED') {
             this.$router.push('/home/assets/workbench/calculate/importInfo')
           } else if (res.data.progress === 'BASE') {
-            this.$router.push('/home/assets/workbench/calculate/qptBaseInfo')
-          } else if (res.data.progress === 'FINISHED') {
-
+            this.$router.push('/home/assets/workbench/calculate/eqptBaseInfo')
           }
           this.projectStore.setCalculateProgress(res.data);
         } else {
@@ -134,13 +99,36 @@ export default {
         }
       })
     },
+    // 前往测算表详情
+    doCalculateBench(item) {
+      this.projectStore.setCalculateProgress(item);
+      // 根据不同进度跳转到不同步骤页面
+      if (item.progress === 'IMPORT' || item.progress === 'GENERATE' || item.progress === 'FINISHED') {
+        this.$router.push('/home/assets/workbench/calculate/importInfo')
+      } else if (item.progress === 'BASE') {
+        this.$router.push('/home/assets/workbench/calculate/eqptBaseInfo')
+      }
+    },
     // 获取测算表list
     getCalculateList() {
       listAllByProjectId(this.projectStore.projectInfo.id).then(res => {
-        if(res.data) {
+        if (res.data) {
           this.calculateList = res.data;
         }
       })
+    },
+    // 下载文件
+    downloadFile(docUrl, docName) {
+      if (docUrl && docName) {
+        let downloadUrl = '/file/download?fileDiskPath=' + docUrl + '&fileName=' + docName
+        fileUtil.download(downloadUrl);
+      } else {
+        ElMessage({
+          showClose: true,
+          message: '文档还未生成,请完成生成步骤!',
+          type: 'warning'
+        })
+      }
     }
   },
 }

+ 2 - 2
src/views/assets/folder/index.vue

@@ -7,9 +7,9 @@
       <section class="bench-main">
         <router-view v-slot="{ Component }">
           <transition>
-            <keep-alive>
+            <!-- <keep-alive> -->
               <component :is="Component" />
-            </keep-alive>
+            <!-- </keep-alive> -->
           </transition>
         </router-view>
       </section>

+ 11 - 1
src/views/assets/workbench/calculate/baseInfo.vue

@@ -30,7 +30,7 @@
 <script>
 import { mapStores } from 'pinia'
 import { assetsProjectInfo } from '@/stores/assetsProjectStore';
-import { createAssetsCalculate } from '@/api/assetsCalculate';
+import { createAssetsCalculate, getUnFinishedCalculateProgress } from '@/api/assetsCalculate';
 export default {
     data() {
         return {
@@ -64,10 +64,20 @@ export default {
                                 message: res.message,
                                 type: 'success'
                             })
+                            this.$router.push('/home/assets/workbench/calculate/eqptBaseInfo')
+                            this.getCalculateProgress();
                         }
                     })
                 }
             })
+        },
+        // 获取未完成测算表的进度信息并保存到缓存
+        getCalculateProgress() {
+            getUnFinishedCalculateProgress(this.projectStore.projectInfo.id).then(res => {
+                if (res.data) {
+                    this.projectStore.setCalculateProgress(res.data);
+                }
+            })
         }
     }
 }

+ 27 - 22
src/views/assets/workbench/calculate/components/timeline.vue

@@ -2,38 +2,42 @@
   <div class="contrl-bar">
     <el-timeline style="max-width: 600px">
       <el-timeline-item
-        :timestamp="(progress === 'BASE' || progress === 'IMPORT' || progress === 'GENERATE' || progress === 'FINISHED') ? '已完成' : '未完成'"
+        :timestamp="projectStore.calculateProgress && (projectStore.calculateProgress.progress === 'BASE' || projectStore.calculateProgress.progress === 'IMPORT' || projectStore.calculateProgress.progress === 'GENERATE' || projectStore.calculateProgress.progress === 'FINISHED') ? '已完成' : '未完成'"
         placement="top"
-        :color="(progress === 'BASE' || progress === 'IMPORT' || progress === 'GENERATE' || progress === 'FINISHED') ? '#ff6154' : '#dae1eb'"
-        @click="goBench('/home/assets/workbench/calculate/baseInfo')">
+        :color="projectStore.calculateProgress && (projectStore.calculateProgress.progress === 'BASE' || projectStore.calculateProgress.progress === 'IMPORT' || projectStore.calculateProgress.progress === 'GENERATE' || projectStore.calculateProgress.progress === 'FINISHED') ? '#ff6154' : '#dae1eb'"
+        @click="goBench('/home/assets/workbench/calculate/baseInfo', ['BASE', 'IMPORT', 'GENERATE', 'FINISHED'])">
         <el-card shadow="never" class="timeline-card report-item">
           <h4>创建测算表</h4>
-          <p>更新时间: 2018/4/12 20:46</p>
+          <!-- <p>更新时间: 2018/4/12 20:46</p> -->
         </el-card>
       </el-timeline-item>
       <el-timeline-item
-        :timestamp="(progress === 'IMPORT' || progress === 'GENERATE' || progress === 'FINISHED') ? '已完成' : '未完成'"
+        :timestamp="projectStore.calculateProgress && (projectStore.calculateProgress.progress === 'IMPORT' || projectStore.calculateProgress.progress === 'GENERATE' || projectStore.calculateProgress.progress === 'FINISHED') ? '已完成' : '未完成'"
         placement="top"
-        :color="(progress === 'IMPORT' || progress === 'GENERATE' || progress === 'FINISHED') ? '#ff6154' : '#dae1eb'"
-        @click="goBench('/home/assets/workbench/calculate/eqptBaseInfo')">
+        :color="projectStore.calculateProgress && (projectStore.calculateProgress.progress === 'IMPORT' || projectStore.calculateProgress.progress === 'GENERATE' || projectStore.calculateProgress.progress === 'FINISHED') ? '#ff6154' : '#dae1eb'"
+        @click="goBench('/home/assets/workbench/calculate/eqptBaseInfo', ['BASE', 'IMPORT', 'GENERATE', 'FINISHED'])">
         <el-card shadow="never" class="timeline-card report-item">
           <h4>填写基本信息</h4>
-          <p>更新时间: 2018/4/12 20:46</p>
+          <!-- <p>更新时间: 2018/4/12 20:46</p> -->
         </el-card>
       </el-timeline-item>
-      <el-timeline-item :timestamp="(progress === 'GENERATE' || progress === 'FINISHED') ? '已完成' : '未完成'" placement="top"
-        :color="(progress === 'GENERATE' || progress === 'FINISHED') ? '#ff6154' : '#dae1eb'"
-        @click="goBench('/home/assets/workbench/calculate/importInfo')">
+      <el-timeline-item
+        :timestamp="projectStore.calculateProgress && (projectStore.calculateProgress.progress === 'GENERATE' || projectStore.calculateProgress.progress === 'FINISHED') ? '已完成' : '未完成'"
+        placement="top"
+        :color="projectStore.calculateProgress && (projectStore.calculateProgress.progress === 'GENERATE' || projectStore.calculateProgress.progress === 'FINISHED') ? '#ff6154' : '#dae1eb'"
+        @click="goBench('/home/assets/workbench/calculate/importInfo', ['IMPORT', 'GENERATE', 'FINISHED'])">
         <el-card shadow="never" class="timeline-card report-item">
           <h4>测算</h4>
-          <p>更新时间: 2018/4/12 20:46</p>
+          <!-- <p>更新时间: 2018/4/12 20:46</p> -->
         </el-card>
       </el-timeline-item>
-      <el-timeline-item :timestamp="(progress === 'FINISHED') ? '已完成' : '未完成'" placement="top"
-        :color="(progress === 'FINISHED') ? '#ff6154' : '#dae1eb'">
+      <el-timeline-item
+        :timestamp="projectStore.calculateProgress && (projectStore.calculateProgress.progress === 'FINISHED') ? '已完成' : '未完成'"
+        placement="top"
+        :color="projectStore.calculateProgress && (projectStore.calculateProgress.progress === 'FINISHED') ? '#ff6154' : '#dae1eb'">
         <el-card shadow="never" class="timeline-card report-item">
           <h4>生成测算表</h4>
-          <p>更新时间: 2018/4/12 20:46</p>
+          <!-- <p>更新时间: 2018/4/12 20:46</p> -->
         </el-card>
       </el-timeline-item>
     </el-timeline>
@@ -47,20 +51,20 @@ import { assetsProjectInfo } from '@/stores/assetsProjectStore';
 export default {
   data() {
     return {
-      progress: ''
+
     }
   },
   computed: {
     ...mapStores(assetsProjectInfo),
   },
   created() {
-    if (this.projectStore.calculateProgress) {
-      this.progress = this.projectStore.calculateProgress.progress;
-    }
+
   },
   methods: {
-    goBench(route){
-      this.$router.push(route)
+    goBench(route, progress) {
+      if(this.projectStore.calculateProgress && this.projectStore.calculateProgress.progress && progress.includes(this.projectStore.calculateProgress.progress)) {
+        this.$router.push(route)
+      }
     }
   }
 }
@@ -79,4 +83,5 @@ export default {
 
 .timeline-card:hover {
   cursor: pointer;
-}</style>
+}
+</style>

+ 3 - 26
src/views/assets/workbench/calculate/eqptBaseInfo.vue

@@ -35,26 +35,6 @@
                     </el-form-item>
                 </el-col>
             </el-row>
-            <el-switch v-model="hasImportedEquipment" style="--el-switch-on-color: #ff6154;" active-text="有进口设备"
-                inactive-text="无进口设备" />
-            <el-divider v-if="hasImportedEquipment" content-position="left"><span
-                    style="color:#ff6154;">进口设备信息</span></el-divider>
-            <el-row v-if="hasImportedEquipment" :gutter="10">
-                <el-col :span="12">
-                    <el-form-item label="关税:" class="form-item" prop="tariff">
-                        <el-input-number v-model="eqptBaseInfo.tariff" clearable style="width: 95%;" :precision="2"
-                            :step="0.1" />%
-                    </el-form-item>
-                </el-col>
-            </el-row>
-            <el-row v-if="hasImportedEquipment" :gutter="10">
-                <el-col :span="12">
-                    <el-form-item label="进口增值税:" class="form-item" prop="importVAT">
-                        <el-input-number v-model="eqptBaseInfo.importVAT" clearable style="width: 95%;" :precision="2"
-                            :step="0.1" />%
-                    </el-form-item>
-                </el-col>
-            </el-row>
             <el-button plain type="danger" style="float: right;" @click="updateBaseInfo()">
                 下一步
                 <el-icon style="vertical-align: -20%;">
@@ -88,12 +68,6 @@ export default {
                 ],
                 managementExpenseRatio: [
                     { required: true, message: '请输入建设单位管理费率', trigger: 'blur' }
-                ],
-                tariff: [
-                    { required: true, message: '请输入关税', trigger: 'blur' }
-                ],
-                importVAT: [
-                    { required: true, message: '请输入进口增值税', trigger: 'blur' }
                 ]
             }
         }
@@ -119,6 +93,9 @@ export default {
                                 message: res.message,
                                 type: 'success'
                             })
+                            // 更新本地缓存的测算表进度
+                            this.projectStore.calculateProgress.progress = 'IMPORT';
+                            this.$router.push('/home/assets/workbench/calculate/importInfo');
                         }
                     })
                 }

+ 3 - 1
src/views/assets/workbench/calculate/importInfo.vue

@@ -26,6 +26,7 @@
             <el-button type="danger" @click="uploadEqptExcel()">
                 确认上传
             </el-button>
+            <el-button type="danger" @click="generateEquipmentCalculate()">生成测算表</el-button>
         </div>
         <div class="evaluateDiv">
             <div class="search">
@@ -895,7 +896,6 @@
                 </el-table-column>
             </el-table>
         </div>
-        <!-- <el-button @click="generateEquipmentCalculate()">生成测算表</el-button> -->
         <el-pagination v-if="activeName === 'all'" background layout="prev, pager, next"
             style="--el-color-primary: #ff6154;margin-top: 20px; float: right;" v-model:page-count="eqptDataQuery.pages"
             v-model:current-page="eqptDataQuery.current" @current-change="getEqptDataPage" />
@@ -1275,6 +1275,8 @@ export default {
                         message: res.message,
                         type: 'success'
                     })
+                    // 更新本地缓存的测算表进度
+                    this.projectStore.calculateProgress.progress = 'FINISHED'
                 }
             })
         },