|
@@ -483,10 +483,9 @@
|
|
<script>
|
|
<script>
|
|
import {getLazytree,getDetail,update,selectByNodeTable,getAlltree,
|
|
import {getLazytree,getDetail,update,selectByNodeTable,getAlltree,
|
|
saveFormAndElement,selectFormElements,removeTableById,
|
|
saveFormAndElement,selectFormElements,removeTableById,
|
|
- importWbsTree} from "@/api/manager/wbstree";
|
|
|
|
|
|
+ importWbsTree,exportTemplate} from "@/api/manager/wbstree";
|
|
import {saveElement,remove as removeElement,updateBatchElements,getTemplate,
|
|
import {saveElement,remove as removeElement,updateBatchElements,getTemplate,
|
|
importWbsElement} from "@/api/manager/wbsformelement";
|
|
importWbsElement} from "@/api/manager/wbsformelement";
|
|
- import {getList as getAttchFromOriginalName} from "@/api/resource/attach";
|
|
|
|
import {getDictionary} from "@/api/system/dict";
|
|
import {getDictionary} from "@/api/system/dict";
|
|
import {mapGetters} from "vuex";
|
|
import {mapGetters} from "vuex";
|
|
export default {
|
|
export default {
|
|
@@ -900,19 +899,6 @@
|
|
importTemplate(data){
|
|
importTemplate(data){
|
|
this.importTemplateVisible = true;
|
|
this.importTemplateVisible = true;
|
|
this.curTreeData = data;
|
|
this.curTreeData = data;
|
|
-
|
|
|
|
- if(!this.fileUrl){
|
|
|
|
- getAttchFromOriginalName(1, 20, {
|
|
|
|
- originalName:'WBS划分模板.xls'
|
|
|
|
- }).then((res)=>{
|
|
|
|
- if(res.data.data.records.length){
|
|
|
|
- this.fileUrl = res.data.data.records[0].link;
|
|
|
|
- }else{
|
|
|
|
- this.fileUrl = '';
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
@@ -946,14 +932,10 @@
|
|
},
|
|
},
|
|
|
|
|
|
handleDownload() {
|
|
handleDownload() {
|
|
- if(this.fileUrl){
|
|
|
|
- window.open(this.fileUrl);
|
|
|
|
- }else{
|
|
|
|
- this.$message({
|
|
|
|
- type: "warning",
|
|
|
|
- message: "请先在附件管理上传【WBS划分模板.xls】文件"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ //WBS划分模板
|
|
|
|
+ exportTemplate().then((res)=>{
|
|
|
|
+ this.downloadExcel(res.data,'WBS划分模板')
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
fileClick(){
|
|
fileClick(){
|
|
@@ -990,22 +972,7 @@
|
|
downloadTmp(){
|
|
downloadTmp(){
|
|
getTemplate().then((res)=>{
|
|
getTemplate().then((res)=>{
|
|
//console.log(res)
|
|
//console.log(res)
|
|
- let blob = new Blob([res.data], {
|
|
|
|
- type: 'application/vnd.ms-excel'
|
|
|
|
- });
|
|
|
|
- //console.log(blob)
|
|
|
|
- let filename = Date.parse(new Date()) + '.xls';
|
|
|
|
- if (window.navigator.msSaveOrOpenBlob) {
|
|
|
|
- // 兼容IE10
|
|
|
|
- window.navigator.msSaveBlob(blob, filename);
|
|
|
|
- } else {
|
|
|
|
- // 兼容chrome/firefox
|
|
|
|
- let aTag = document.createElement('a');
|
|
|
|
- aTag.download = Date.parse(new Date()) + '.xls';
|
|
|
|
- aTag.href = window.URL.createObjectURL(blob);
|
|
|
|
- aTag.click();
|
|
|
|
- URL.revokeObjectURL(aTag.href);
|
|
|
|
- }
|
|
|
|
|
|
+ this.downloadExcel(res.data,'元素模板')
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
@@ -1041,6 +1008,28 @@
|
|
this.$set(data, 'moreShow', value)
|
|
this.$set(data, 'moreShow', value)
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ downloadExcel(data,filename=''){
|
|
|
|
+ let blob = new Blob([data], {
|
|
|
|
+ type: 'application/vnd.ms-excel'
|
|
|
|
+ });
|
|
|
|
+ //console.log(blob)
|
|
|
|
+ if(!filename){
|
|
|
|
+ filename = Date.parse(new Date());
|
|
|
|
+ }
|
|
|
|
+ filename = filename+ '.xls';
|
|
|
|
+ if (window.navigator.msSaveOrOpenBlob) {
|
|
|
|
+ // 兼容IE10
|
|
|
|
+ window.navigator.msSaveBlob(blob, filename);
|
|
|
|
+ } else {
|
|
|
|
+ // 兼容chrome/firefox
|
|
|
|
+ let aTag = document.createElement('a');
|
|
|
|
+ aTag.download = filename;
|
|
|
|
+ aTag.href = window.URL.createObjectURL(blob);
|
|
|
|
+ aTag.click();
|
|
|
|
+ URL.revokeObjectURL(aTag.href);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
getDeptCategorylist(){
|
|
getDeptCategorylist(){
|
|
if(this.deptCategorylist.length >1){
|
|
if(this.deptCategorylist.length >1){
|
|
return;
|
|
return;
|