|
@@ -18,38 +18,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row :gutter="10">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="上传测算表:" class="form-item" prop="calculateFile">
|
|
|
- <el-upload
|
|
|
- ref="uploadCRCalculateExcel"
|
|
|
- drag
|
|
|
- action="#"
|
|
|
- multiple
|
|
|
- style="width:100%;"
|
|
|
- accept=".xls, .xlsx"
|
|
|
- :limit="1"
|
|
|
- :file-list="fileList"
|
|
|
- :on-exceed="handleExceed"
|
|
|
- :before-remove="beforeRemove"
|
|
|
- :auto-upload="true"
|
|
|
- :http-request="uploadCRCalculateExcel"
|
|
|
- >
|
|
|
- <el-icon class="el-icon--upload">
|
|
|
- <upload-filled />
|
|
|
- </el-icon>
|
|
|
- <div class="el-upload__text">
|
|
|
- 拖拽文件
|
|
|
- <em>或点击上传</em> 测算表
|
|
|
- </div>
|
|
|
- <template #tip>
|
|
|
- <div class="el-upload__tip">文件大小限制在100MB及以下</div>
|
|
|
- </template>
|
|
|
- </el-upload>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-button plain type="danger" style="float: right;" @click="createCalculate()">完成</el-button>
|
|
|
+ <el-button plain type="danger" style="float: right;" @click="createCalculate()">下一步</el-button>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -58,21 +27,14 @@
|
|
|
import { mapStores } from 'pinia'
|
|
|
import { assetsProjectInfo } from '@/stores/assetsProjectStore'
|
|
|
import { createAssetsCalculate, getUnFinishedCalculateProgress } from '@/api/assetsCalculate'
|
|
|
-import { uploadAssetsCRCalculate } from '@/api/fileUpload'
|
|
|
import documentProduction from '@/api/documentProduction'
|
|
|
export default {
|
|
|
data() {
|
|
|
- var calculateFile = (rule, value, callback) => {
|
|
|
- if (this.fileList < 1) {
|
|
|
- return callback(new Error('请上传债权测算表'))
|
|
|
- }
|
|
|
- }
|
|
|
return {
|
|
|
baseInfo: {},
|
|
|
baseInfoRules: {
|
|
|
calculateName: [{ required: true, message: '请输入测算表名', trigger: 'blur' }],
|
|
|
valuationBasisDate: [{ required: true, message: '请选择评估基准日', trigger: 'blur' }],
|
|
|
- calculateFile: [{ required: true, validator: calculateFile, trigger: 'change' }],
|
|
|
},
|
|
|
fileList: [],
|
|
|
}
|
|
@@ -97,43 +59,11 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 文件上传数量限制
|
|
|
- handleExceed() {
|
|
|
- ElMessage({
|
|
|
- showClose: true,
|
|
|
- message: '最多选择一个文件!',
|
|
|
- type: 'error',
|
|
|
- })
|
|
|
- },
|
|
|
- // 移除文件
|
|
|
- beforeRemove(file, fileList) {
|
|
|
- fileList = fileList.filter((o) => {
|
|
|
- return o.name !== file.name
|
|
|
- })
|
|
|
- this.fileList = []
|
|
|
- this.tmplAssetCalculate.fileName = null
|
|
|
- this.tmplAssetCalculate.fileUrl = null
|
|
|
- },
|
|
|
- // 上传债权测算表
|
|
|
- uploadCRCalculateExcel(item) {
|
|
|
- let crCalculateExcel = new FormData()
|
|
|
- crCalculateExcel.append('multipartFile', item.file)
|
|
|
- uploadAssetsCRCalculate(crCalculateExcel).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- ElMessage({
|
|
|
- showClose: true,
|
|
|
- message: res.message,
|
|
|
- type: 'success',
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 创建测算表,填写测算表基础信息
|
|
|
createCalculate() {
|
|
|
this.$refs.baseInfo.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- // 债权目前没有在线测算的需求,直接完成进度
|
|
|
- this.baseInfo.progress = 'FINISHED'
|
|
|
+ this.baseInfo.progress = 'BASE'
|
|
|
this.baseInfo.projectId = this.projectStore.projectInfo.id
|
|
|
createAssetsCalculate(this.baseInfo).then((res) => {
|
|
|
if (res.code == 200) {
|
|
@@ -142,12 +72,21 @@ export default {
|
|
|
message: res.message,
|
|
|
type: 'success',
|
|
|
})
|
|
|
- this.$router.push('/home/assets/workbench/calculate/eqptBaseInfo')
|
|
|
+ this.getCalculateProgress()
|
|
|
+ this.$router.push('/home/assets/workbench/cr/calculate/uploadCalculate')
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 获取未完成测算表的进度信息并保存到缓存
|
|
|
+ getCalculateProgress() {
|
|
|
+ getUnFinishedCalculateProgress(this.projectStore.projectInfo.id).then((res) => {
|
|
|
+ if (res.data) {
|
|
|
+ this.projectStore.setCalculateProgress(res.data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|