|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="contrl">
|
|
|
- <el-tabs v-model="activeName" class="condtion-tabs">
|
|
|
+ <el-tabs v-model="activeName" class="condtion-tabs" @tab-change="tabChange()">
|
|
|
<el-tab-pane label="创建主模板" name="main">
|
|
|
<div>
|
|
|
<el-form ref="createCalculateTmpl" :model="tmplAssetCalculate" :rules="createRules" label-width="auto"
|
|
@@ -21,7 +21,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row :gutter="10" v-if="tmplAssetCalculate.tmplType === 'true'">
|
|
|
+ <el-row :gutter="10">
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="是否有段落模板:" class="form-item" prop="hasSection">
|
|
|
<el-radio-group v-model="tmplAssetCalculate.hasSection">
|
|
@@ -83,8 +83,8 @@
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="创建段落模板" name="section">
|
|
|
<div>
|
|
|
- <el-form ref="createCalculateSectionTmpl" :model="tmplAssetCalculateSection" :rules="createSectionRules" label-width="auto"
|
|
|
- style="margin-top: 10px;">
|
|
|
+ <el-form ref="createCalculateSectionTmpl" :model="tmplAssetCalculateSection" :rules="createSectionRules"
|
|
|
+ label-width="auto" style="margin-top: 10px;">
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="段落模板名称:" class="form-item" prop="sectionName">
|
|
@@ -93,9 +93,10 @@
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="主模板id:" class="form-item" prop="tmplCode">
|
|
|
- <el-select v-model="tmplAssetCalculateSection.templateReportId" placeholder="选择主模板">
|
|
|
- <el-option v-for="item in calculateDropDownBoxData" :key="item.id" :label="item.name"
|
|
|
- :value="item.id" />
|
|
|
+ <el-select v-model="tmplAssetCalculateSection.templateCalculateId"
|
|
|
+ placeholder="选择主模板">
|
|
|
+ <el-option v-for="item in calculateDropDownBoxData" :key="item.id"
|
|
|
+ :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -103,8 +104,8 @@
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="测算类型:" class="form-item" prop="calculateType">
|
|
|
- <el-select v-model="tmplAssetCalculateSection.calculateType" placeholder="选择测算类型"
|
|
|
- @change="calculateTypeChange">
|
|
|
+ <el-select v-model="tmplAssetCalculateSection.calculateType"
|
|
|
+ placeholder="选择测算类型" @change="calculateTypeChange">
|
|
|
<el-option v-for="item in calculateType" :key="item.value"
|
|
|
:label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
@@ -124,22 +125,24 @@
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="模板文件名字:" class="form-item" prop="sectionFileName">
|
|
|
- <el-input v-model="tmplAssetCalculateSection.sectionFileName" clearable disabled />
|
|
|
+ <el-input v-model="tmplAssetCalculateSection.sectionFileName" clearable
|
|
|
+ disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="模板文件存储位置:" class="form-item" prop="sectionFileUrl">
|
|
|
- <el-input v-model="tmplAssetCalculateSection.sectionFileUrl" clearable disabled />
|
|
|
+ <el-input v-model="tmplAssetCalculateSection.sectionFileUrl" clearable
|
|
|
+ disabled />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-upload drag action="#" multiple style="width:50%;margin-left:25%;" accept=".xls,.xlsx"
|
|
|
- :limit="1" :http-request="handleSectionUpload" :file-list="sectionFileList" :on-exceed="handleExceed"
|
|
|
- :before-remove="beforeRemove">
|
|
|
+ :limit="1" :http-request="handleSectionUpload" :file-list="sectionFileList"
|
|
|
+ :on-exceed="handleExceed" :before-remove="beforeRemove">
|
|
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
<div class="el-upload__text">
|
|
|
拖拽文件 <em>或点击上传</em>
|
|
@@ -170,7 +173,7 @@
|
|
|
<script>
|
|
|
|
|
|
import { uploadAssetsCalculateTmpl } from '@/api/fileUpload'
|
|
|
-import { getDropDownBoxData,createTmplAssetCalculate } from '@/api/tmplAssetCalculate'
|
|
|
+import { getDropDownBoxData, createTmplAssetCalculate } from '@/api/tmplAssetCalculate'
|
|
|
import { createTmplAssetCalculateSection } from '@/api/tmplAssetCalculateSection'
|
|
|
|
|
|
export default {
|
|
@@ -252,13 +255,13 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
tmplAssetCalculateSection: {
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
createSectionRules: {
|
|
|
sectionName: [
|
|
|
{ required: true, message: '请输入段落模板名称', trigger: 'blur' }
|
|
|
],
|
|
|
- templateReportId: [
|
|
|
+ templateCalculateId: [
|
|
|
{ required: true, message: '请选择主模板', trigger: 'change' }
|
|
|
],
|
|
|
calculateType: [
|
|
@@ -278,10 +281,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.getDropDownBoxData();
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
- getDropDownBoxData(){
|
|
|
+ tabChange() {
|
|
|
+ if (this.activeName === "section") {
|
|
|
+ this.getDropDownBoxData();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getDropDownBoxData() {
|
|
|
getDropDownBoxData().then(res => {
|
|
|
this.calculateDropDownBoxData = res.data
|
|
|
})
|
|
@@ -330,15 +338,12 @@ export default {
|
|
|
createTmplAssetCalculate(this.tmplAssetCalculate).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$refs.createCalculateTmpl.resetFields();
|
|
|
+ this.tmplCodes = null;
|
|
|
this.fileList = [];
|
|
|
ElMessage({
|
|
|
showClose: true,
|
|
|
message: res.message,
|
|
|
- type: 'success',
|
|
|
- onClose: () => {
|
|
|
- // 跳转到模板列表页面
|
|
|
- this.$router.push('/home/assets/template/mange')
|
|
|
- }
|
|
|
+ type: 'success'
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -381,15 +386,12 @@ export default {
|
|
|
createTmplAssetCalculateSection(this.tmplAssetCalculateSection).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$refs.createCalculateSectionTmpl.resetFields();
|
|
|
- this.fileList = [];
|
|
|
+ this.tmplCodes = null;
|
|
|
+ this.sectionFileList = [];
|
|
|
ElMessage({
|
|
|
showClose: true,
|
|
|
message: res.message,
|
|
|
- type: 'success',
|
|
|
- onClose: () => {
|
|
|
- // 跳转到模板列表页面
|
|
|
- this.$router.push('/home/assets/template/mange')
|
|
|
- }
|
|
|
+ type: 'success'
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -418,5 +420,4 @@ export default {
|
|
|
--el-color-primary-light-8: #ffa999;
|
|
|
--el-color-primary-light-9: #ffa854;
|
|
|
--el-color-primary-dark-2: #ff8154;
|
|
|
-}
|
|
|
-</style>
|
|
|
+}</style>
|