|
@@ -10,6 +10,26 @@
|
|
|
width="1500px"
|
|
width="1500px"
|
|
|
>
|
|
>
|
|
|
<div class="user-panel" v-loading="loading">
|
|
<div class="user-panel" v-loading="loading">
|
|
|
|
|
+ <el-row class="button-group">
|
|
|
|
|
+ <el-upload
|
|
|
|
|
+ class="upload-demo"
|
|
|
|
|
+ accept=".xlsx"
|
|
|
|
|
+ name="uploadFile"
|
|
|
|
|
+ :headers="headers"
|
|
|
|
|
+ :action="uploadUrlXls"
|
|
|
|
|
+ :data="uploadXlsData"
|
|
|
|
|
+ :on-preview="handlePreview"
|
|
|
|
|
+ :on-remove="handleRemove"
|
|
|
|
|
+ :before-remove="beforeRemove"
|
|
|
|
|
+ :on-exceed="handleExceed"
|
|
|
|
|
+ :on-success="handleSuccess"
|
|
|
|
|
+ :file-list="fileList">
|
|
|
|
|
+ <el-button size="small" plain icon="el-icon-upload2" type="success">导入EXCEL项目</el-button>
|
|
|
|
|
+ <div slot="tip" class="el-upload__tip">只能上传.xlsx文件</div>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ <el-button style="float:right" type="primary" size="small" plain icon="el-icon-document-copy" @click="handleCopy">从其它模板复制项目</el-button>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+
|
|
|
<el-form
|
|
<el-form
|
|
|
ref="form"
|
|
ref="form"
|
|
|
:model="formModel"
|
|
:model="formModel"
|
|
@@ -59,18 +79,18 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column prop="budgetRevenue" label="预算收入(元)" width="160">
|
|
|
|
|
|
|
+ <el-table-column prop="budgetRevenue" label="预算收支(元)" width="160">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
:prop="'optionList.' + scope.$index + '.budgetRevenue'"
|
|
:prop="'optionList.' + scope.$index + '.budgetRevenue'"
|
|
|
:rules="ruleValidate['budgetRevenue']"
|
|
:rules="ruleValidate['budgetRevenue']"
|
|
|
>
|
|
>
|
|
|
- <el-input-number v-if="!scope.row.isSum" placeholder="预算收入" v-model="scope.row.budgetRevenue" size="mini" style="width:130px">
|
|
|
|
|
|
|
+ <el-input-number v-if="!scope.row.isSum" placeholder="预算收支" v-model="scope.row.budgetRevenue" size="mini" style="width:130px">
|
|
|
</el-input-number>
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column prop="incomeTimeRangeArr" label="收入区间" width="250">
|
|
|
|
|
|
|
+ <el-table-column prop="incomeTimeRangeArr" label="收支区间" width="250">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
:prop="'optionList.' + scope.$index + '.incomeTimeRangeArr'"
|
|
:prop="'optionList.' + scope.$index + '.incomeTimeRangeArr'"
|
|
@@ -168,6 +188,11 @@
|
|
|
>确 定</el-button
|
|
>确 定</el-button
|
|
|
>
|
|
>
|
|
|
</span>
|
|
</span>
|
|
|
|
|
+ <selectTemplateCopy-list
|
|
|
|
|
+ v-if="showModal"
|
|
|
|
|
+ :title="modalTitle"
|
|
|
|
|
+ @close="onDetailModalClose"
|
|
|
|
|
+ ></selectTemplateCopy-list>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -175,6 +200,7 @@
|
|
|
import { getToken } from "@/utils/auth"; // get token from cookie
|
|
import { getToken } from "@/utils/auth"; // get token from cookie
|
|
|
import templateOptionApi from "@/api/base/templateOption";
|
|
import templateOptionApi from "@/api/base/templateOption";
|
|
|
import departmentInfoApi from "@/api/base/departmentInfo";
|
|
import departmentInfoApi from "@/api/base/departmentInfo";
|
|
|
|
|
+ import selectTemplateCopyList from "./selectTemplateCopy-list";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
props: ["businessKey", "title"],
|
|
props: ["businessKey", "title"],
|
|
@@ -198,6 +224,7 @@
|
|
|
enterpriseList:[],
|
|
enterpriseList:[],
|
|
|
optionList:[],
|
|
optionList:[],
|
|
|
departmentList:[],
|
|
departmentList:[],
|
|
|
|
|
+ showModal:false,
|
|
|
isSumList:[
|
|
isSumList:[
|
|
|
{
|
|
{
|
|
|
"label":"否",
|
|
"label":"否",
|
|
@@ -206,7 +233,15 @@
|
|
|
{
|
|
{
|
|
|
"label":"是",
|
|
"label":"是",
|
|
|
"value":true
|
|
"value":true
|
|
|
- }]
|
|
|
|
|
|
|
+ }],
|
|
|
|
|
+ uploadUrlXls: Constant.serverUrl + "/base/templateOption/importXls",
|
|
|
|
|
+ uploadXlsData: {
|
|
|
|
|
+ templateId:this.businessKey
|
|
|
|
|
+ },
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ Authorization: getToken(),
|
|
|
|
|
+ },
|
|
|
|
|
+ fileList:[],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -278,6 +313,63 @@
|
|
|
var optionList = this.formModel.optionList;
|
|
var optionList = this.formModel.optionList;
|
|
|
optionList.splice(optionList.indexOf(row), 1);
|
|
optionList.splice(optionList.indexOf(row), 1);
|
|
|
},
|
|
},
|
|
|
|
|
+ handleCopy(){
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+
|
|
|
|
|
+ self.modalTitle = "选择复制模板项目";
|
|
|
|
|
+ self.showModal = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ onDetailModalClose(selectId) {
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+
|
|
|
|
|
+ self.showModal = false;
|
|
|
|
|
+
|
|
|
|
|
+ //alert(selectId)
|
|
|
|
|
+
|
|
|
|
|
+ self.loading = true;
|
|
|
|
|
+
|
|
|
|
|
+ var formData = new FormData();
|
|
|
|
|
+
|
|
|
|
|
+ formData.append("selectId", selectId);
|
|
|
|
|
+ formData.append("templateId", self.businessKey);
|
|
|
|
|
+
|
|
|
|
|
+ templateOptionApi.copyOptionList(formData).then(function(response) {
|
|
|
|
|
+ self.loading = false;
|
|
|
|
|
+ var jsonData = response.data;
|
|
|
|
|
+ if(jsonData.result) {
|
|
|
|
|
+ self.formModel = jsonData.data;
|
|
|
|
|
+ self.formModel.optionList = jsonData.data.templateOptionList;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ //批量导入-预览
|
|
|
|
|
+ handlePreview(file) {
|
|
|
|
|
+ console.log(file.url);
|
|
|
|
|
+ },
|
|
|
|
|
+ //批量导入-移除
|
|
|
|
|
+ handleRemove(file, fileList) {
|
|
|
|
|
+ console.log(file, fileList);
|
|
|
|
|
+ },
|
|
|
|
|
+ //批量导入-移除前操作
|
|
|
|
|
+ beforeRemove(file, fileList) {
|
|
|
|
|
+ console.log(file, fileList);
|
|
|
|
|
+ },
|
|
|
|
|
+ //批量导入-文件超出个数限制时的钩子
|
|
|
|
|
+ handleExceed(files, fileList) {
|
|
|
|
|
+ this.$message.warning(
|
|
|
|
|
+ `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
|
|
+ files.length + fileList.length
|
|
|
|
|
+ } 个文件`
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSuccess(res, file) {
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ if(res.result){
|
|
|
|
|
+ self.formModel = res.data;
|
|
|
|
|
+ self.formModel.optionList = res.data.templateOptionList;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
async mounted() {
|
|
async mounted() {
|
|
|
var self = this;
|
|
var self = this;
|
|
@@ -297,7 +389,7 @@
|
|
|
self.formModel.templateId = jsonData.data.templateId;
|
|
self.formModel.templateId = jsonData.data.templateId;
|
|
|
self.formModel.optionList = jsonData.data.templateOptionList;
|
|
self.formModel.optionList = jsonData.data.templateOptionList;
|
|
|
|
|
|
|
|
- self.showModal = true;
|
|
|
|
|
|
|
+ //self.showModal = true;
|
|
|
} else {
|
|
} else {
|
|
|
self.$message.error(jsonData.message + "");
|
|
self.$message.error(jsonData.message + "");
|
|
|
}
|
|
}
|
|
@@ -310,7 +402,8 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
components: {
|
|
components: {
|
|
|
- },
|
|
|
|
|
|
|
+ "selectTemplateCopy-list":selectTemplateCopyList
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
<style scoped>
|
|
<style scoped>
|