|
@@ -2,14 +2,14 @@
|
|
|
<div class="contrl">
|
|
|
<div style="width: 95%;">
|
|
|
<div class="title-div">
|
|
|
- <p>{{ projectInfo.folderName }}</p>
|
|
|
+ <p>{{ projectStore.projectInfo.projectName }}</p>
|
|
|
</div>
|
|
|
<div class="createNew-div">
|
|
|
<img src="../../../assets/icons/word.png" style="width: 32px; height: 32px; float: left;margin-top: 22px;" />
|
|
|
<span style="margin-left: 10px;">新的报告</span>
|
|
|
<img src="../../../assets/icons/plus.png" style="width: 32px; height: 32px;float: right;margin-top: 22px;" />
|
|
|
</div>
|
|
|
- <div class="createNew-div" @click="createNewCalculate()">
|
|
|
+ <div class="createNew-div" @click="getCalculateProgress()">
|
|
|
<img src="../../../assets/icons/excel.png" style="width: 32px; height: 32px; float: left;margin-top: 22px;" />
|
|
|
<span style="margin-left: 10px;">新的测算表</span>
|
|
|
<img src="../../../assets/icons/plus.png" style="width: 32px; height: 32px;float: right;margin-top: 22px;" />
|
|
@@ -89,6 +89,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapStores } from 'pinia'
|
|
|
+import { assetsProjectInfo } from '@/stores/assetsProjectStore';
|
|
|
+import { getUnFinishedCalculateProgress } from '@/api/assetsCalculate';
|
|
|
+
|
|
|
export default {
|
|
|
name: 'assetsChild',
|
|
|
data() {
|
|
@@ -98,32 +102,39 @@ export default {
|
|
|
folderName: null
|
|
|
}
|
|
|
},
|
|
|
- // watch: {
|
|
|
- // '$route': {
|
|
|
- // handler(newRoute) {
|
|
|
- // if (newRoute.name === 'assetsFolderChild') {
|
|
|
- // if (Object.keys(newRoute.query).length > 0) {
|
|
|
- // this.projectInfo = this.$route.query;
|
|
|
- // } else {
|
|
|
- // if (this.projectInfo) {
|
|
|
- // this.$router.push({ path: '/home/assets/folder', query: { 'projectId': this.projectInfo.projectId, 'folderName': this.projectInfo.folderName } })
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
- // immediate: true
|
|
|
- // }
|
|
|
- // },
|
|
|
+ computed: {
|
|
|
+ ...mapStores(assetsProjectInfo),
|
|
|
+ },
|
|
|
created() {
|
|
|
this.projectInfo = this.$route.query;
|
|
|
},
|
|
|
methods: {
|
|
|
createNewCalculate() {
|
|
|
- // this.$router.push('/home/assets/workbench/calculate/baseInfo')
|
|
|
this.$router.push({ path: '/home/assets/workbench/calculate/baseInfo', query: { 'projectId': this.projectInfo.projectId } })
|
|
|
},
|
|
|
nextFolder() {
|
|
|
|
|
|
+ },
|
|
|
+ // 获取未完成测算表的进度信息并保存到缓存
|
|
|
+ getCalculateProgress() {
|
|
|
+ getUnFinishedCalculateProgress(this.projectStore.projectInfo.id).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ // 根据不同进度跳转到不同步骤页面
|
|
|
+ if (res.data.progress === 'BASE') {
|
|
|
+ this.$router.push('/home/assets/workbench/calculate/importInfo')
|
|
|
+ } else if (res.data.progress === 'IMPORT') {
|
|
|
+
|
|
|
+ } else if (res.data.progress === 'GENERATE') {
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
+ this.projectStore.setCalculateProgress(res.data);
|
|
|
+ } else {
|
|
|
+ // 为空说明没有未完成的测算,从头开始新建
|
|
|
+ this.createNewCalculate();
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
}
|