|
@@ -22,37 +22,40 @@
|
|
<em>或点击上传</em> 测算表
|
|
<em>或点击上传</em> 测算表
|
|
</div>
|
|
</div>
|
|
<template #tip>
|
|
<template #tip>
|
|
- <div class="el-upload__tip">文件大小限制在100MB及以下</div>
|
|
|
|
|
|
+ <div class="el-upload__tip">
|
|
|
|
+ 文件大小限制在100MB及以下
|
|
|
|
+ <el-button type="primary" link @click="downloadTmpl()" style="font-size:12px;margin-bottom: 2px;float:right">下载模板</el-button>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
</el-upload>
|
|
</el-upload>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { mapStores } from 'pinia'
|
|
|
|
-import { assetsProjectInfo } from '@/stores/assetsProjectStore'
|
|
|
|
-import { createAssetsCalculate, getUnFinishedCalculateProgress } from '@/api/assetsCalculate'
|
|
|
|
-import { uploadCalculate } from '@/api/assetsCalculateCRData'
|
|
|
|
|
|
+import { mapStores } from 'pinia';
|
|
|
|
+import { assetsProjectInfo } from '@/stores/assetsProjectStore';
|
|
|
|
+import { createAssetsCalculate, getUnFinishedCalculateProgress } from '@/api/assetsCalculate';
|
|
|
|
+import { uploadCalculate } from '@/api/assetsCalculateCRData';
|
|
|
|
+import fileUtil from '@/utils/file';
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
fileList: [],
|
|
fileList: [],
|
|
- }
|
|
|
|
|
|
+ };
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapStores(assetsProjectInfo),
|
|
...mapStores(assetsProjectInfo),
|
|
},
|
|
},
|
|
- created() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
|
|
+ created() {},
|
|
methods: {
|
|
methods: {
|
|
// 获取未完成测算表的进度信息并保存到缓存
|
|
// 获取未完成测算表的进度信息并保存到缓存
|
|
getCalculateProgress() {
|
|
getCalculateProgress() {
|
|
getUnFinishedCalculateProgress(this.projectStore.projectInfo.id).then((res) => {
|
|
getUnFinishedCalculateProgress(this.projectStore.projectInfo.id).then((res) => {
|
|
if (res.data) {
|
|
if (res.data) {
|
|
- this.projectStore.setCalculateProgress(res.data)
|
|
|
|
|
|
+ this.projectStore.setCalculateProgress(res.data);
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 文件上传数量限制
|
|
// 文件上传数量限制
|
|
handleExceed() {
|
|
handleExceed() {
|
|
@@ -60,35 +63,39 @@ export default {
|
|
showClose: true,
|
|
showClose: true,
|
|
message: '最多选择一个文件!',
|
|
message: '最多选择一个文件!',
|
|
type: 'error',
|
|
type: 'error',
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 移除文件
|
|
// 移除文件
|
|
beforeRemove(file, fileList) {
|
|
beforeRemove(file, fileList) {
|
|
fileList = fileList.filter((o) => {
|
|
fileList = fileList.filter((o) => {
|
|
- return o.name !== file.name
|
|
|
|
- })
|
|
|
|
- this.fileList = []
|
|
|
|
- this.tmplAssetCalculate.fileName = null
|
|
|
|
- this.tmplAssetCalculate.fileUrl = null
|
|
|
|
|
|
+ return o.name !== file.name;
|
|
|
|
+ });
|
|
|
|
+ this.fileList = [];
|
|
|
|
+ this.tmplAssetCalculate.fileName = null;
|
|
|
|
+ this.tmplAssetCalculate.fileUrl = null;
|
|
},
|
|
},
|
|
// 上传债权测算表
|
|
// 上传债权测算表
|
|
uploadCalculate(item) {
|
|
uploadCalculate(item) {
|
|
- let crCalculateExcel = new FormData()
|
|
|
|
- crCalculateExcel.append('calculateId', this.projectStore.calculateProgress.id)
|
|
|
|
- crCalculateExcel.append('multipartFile', item.file)
|
|
|
|
|
|
+ let crCalculateExcel = new FormData();
|
|
|
|
+ crCalculateExcel.append('calculateId', this.projectStore.calculateProgress.id);
|
|
|
|
+ crCalculateExcel.append('multipartFile', item.file);
|
|
uploadCalculate(crCalculateExcel).then((res) => {
|
|
uploadCalculate(crCalculateExcel).then((res) => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
ElMessage({
|
|
ElMessage({
|
|
showClose: true,
|
|
showClose: true,
|
|
message: res.message,
|
|
message: res.message,
|
|
type: 'success',
|
|
type: 'success',
|
|
- })
|
|
|
|
- this.projectStore.calculateProgress.progress = 'FINISHED'
|
|
|
|
|
|
+ });
|
|
|
|
+ this.projectStore.calculateProgress.progress = 'FINISHED';
|
|
}
|
|
}
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 下载测算表模板
|
|
|
|
+ downloadTmpl() {
|
|
|
|
+ fileUtil.download('/file/download/assets/tmpl?tmplCode=ANALYSIS_MAIN&tmplType=MAIN');
|
|
|
|
+ },
|
|
},
|
|
},
|
|
-}
|
|
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|