Commit 2526a101 authored by renjintao's avatar renjintao

plan

parent 3fa5d6a4
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<DropdownItem name="down"> <DropdownItem name="down">
<Icon type="md-cloud-download" class="mr10" />导出Excel <Icon type="md-cloud-download" class="mr10" />导出Excel
</DropdownItem> </DropdownItem>
<DropdownItem name="importExcel" disabled> <DropdownItem name="importExcel">
<Icon type="md-cloud-upload" class="mr10" />导入Excel <Icon type="md-cloud-upload" class="mr10" />导入Excel
</DropdownItem> </DropdownItem>
</DropdownMenu> </DropdownMenu>
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
<ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div> </div>
</template> </template>
...@@ -77,7 +78,6 @@ export default { ...@@ -77,7 +78,6 @@ export default {
}, },
modal: false, modal: false,
title: "新增", title: "新增",
exportTl: '项目目录',
detail: null, detail: null,
curId: null, curId: null,
list: [], list: [],
...@@ -238,6 +238,10 @@ export default { ...@@ -238,6 +238,10 @@ export default {
}, },
}, },
], ],
//导出导入
exportTl: '项目目录',
ModalIm: false,
temTitle: "项目目录",
}; };
}, },
mounted() { mounted() {
...@@ -376,13 +380,76 @@ export default { ...@@ -376,13 +380,76 @@ export default {
that.modal = true; that.modal = true;
}, },
} }
//导出excel
if (name == 'down') { if (name == 'down') {
this.exportTl = '项目目录-' + this.data.title; this.exportTl = '项目目录-' + this.data.title;
this.$refs.grid.export2Excel() this.$refs.grid.export2Excel()
} }
if (name == 'importExcel') {
this.openModalIm()
}
m[name] && m[name](name); m[name] && m[name](name);
}, },
//批量导入start
//导入功能
openModalIm() {
this.ModalIm = true
},
ModalImCancel() {
this.ModalIm = false
},
getData(val) {
let url = `${technologyUrl}routingheaderimportservice/import`;
this.$refs.importExcel.deelData(url, this.columns, this.formatMethod(val))
},
//根据页面二次处理数据
formatMethod(val) {
let tempData = this.$u.clone(val);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
classId: null,
unicode: "",
name: ele.name ? ele.name : '',
code: ele.code ? ele.code : '',
productId: ele.productId ? ele.productId : '', //?
productName: ele.productName ? ele.productName : "", //?
productBomId: ele.productBomId ? ele.productBomId : "", //?
drawingNo: ele.drawingNo ? ele.drawingNo : "", //?
version: "",
versionid: ele.versionid ? ele.versionid : "",
author: null,
departmentId: ele.departmentId ? ele.departmentId : null, //?
departmentName: ele.departmentName ? ele.departmentName : "", //?
isMain: 1,
upId: null,
upDetailId: null,
routingType: ele.routingType ? ele.routingType : null,
status: 0,
approvalStatus: 4, //?
remark: "",
approvalStatusRemark: "",
auditUserId1: "",
auditUserId2: "",
platesnum: null,
versionnotes: "",
isSendPpm: 1,
fileId: "",
phase: ele.phase ? ele.phase : null,
isEffect: ele.isEffect ? ele.isEffect : 1
};
if (ele.name && ele.name != '') {
obj.ico = false
} else {
obj.ico = true
}
tempList.push(obj);
});
return tempList
},
//批量导入end
l(key) { l(key) {
let vkey = "project_plan" + "." + key; let vkey = "project_plan" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment