计划管理导出

lijinlong^2
吕天方 1 year ago
parent b735825b75
commit 59693d9fba

@ -56,7 +56,7 @@
</div> --> </div> -->
<div class="select-input"> <div class="select-input">
<div class="select-span">经济类型:</div> <div class="select-span">经济类型:</div>
<el-select v-model="form.economicsType" placeholder="请选择"> <el-select v-model="form.ecoTypeLarge" placeholder="请选择">
<el-option <el-option
v-for="item in dict.type.economic_categories" v-for="item in dict.type.economic_categories"
:key="item.value" :key="item.value"
@ -355,7 +355,7 @@ export default {
subdistrict:'', subdistrict:'',
form: { form: {
subdistrict: [], subdistrict: [],
frimType: "", ecoTypeLarge: "",
indusTypeClass: "", indusTypeClass: "",
isPoint: "", isPoint: "",
majorHazardLevel: "", majorHazardLevel: "",
@ -392,6 +392,7 @@ export default {
// unselected: 0, // unselected: 0,
selectList: [], selectList: [],
disabled:false, disabled:false,
county:false,
}; };
}, },
computed: { computed: {
@ -431,7 +432,7 @@ export default {
// //
componendDistrict(district){ componendDistrict(district){
let name let name
this.myDistrict.map((item)=>{ this.district.map((item)=>{
if(item.subdistrict == district) { if(item.subdistrict == district) {
name = item.institutionName name = item.institutionName
} else { } else {
@ -471,19 +472,26 @@ export default {
let obj let obj
// //
if(!this.disabled) { if(!this.disabled) {
if(this.form.subdistrict.length > 0){ // console.log('123')
if(Array.isArray(this.form.subdistrict)){
if(this.form.subdistrict.length == 2) { if(this.form.subdistrict.length == 2) {
this.form.subdistrict = this.form.subdistrict[1] this.subdistrict = this.form.subdistrict[2].slice(1, 11);
this.subdistrict = this.form.subdistrict.slice(1, 11);
obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
} else if(this.form.subdistrict.length == 1) { } else if(this.form.subdistrict.length == 1) {
this.form.subdistrict = this.form.subdistrict[0] this.subdistrict = this.form.subdistrict[1].slice(1, 8);
this.subdistrict = this.form.subdistrict.slice(1, 8);
obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
}
} else { } else {
obj = {...this.pages,...this.form} obj = {...this.pages,...this.form}
} }
} else {
if(this.county){
let subdistrict = this.form.subdistrict.slice(1, 8);
obj = { ...this.pages, ...this.form,subdistrict };
} else {
let subdistrict = this.form.subdistrict.slice(1, 8);
obj = { ...this.pages, ...this.form,subdistrict };
}
}
} else { } else {
// //
// if(this.dept.ancestors.split(',').length == 2) { // if(this.dept.ancestors.split(',').length == 2) {
@ -647,9 +655,17 @@ export default {
this.pages = pages; this.pages = pages;
console.log(this.form) console.log(this.form)
if(this.dept.ancestors.split(',').length == 2){ if(this.dept.ancestors.split(',').length == 2){
if(Array.isArray(this.form.subdistrict)) {
this.subdistrict = this.form.subdistrict.slice(1, 8); this.subdistrict = this.form.subdistrict.slice(1, 8);
} else {
this.subdistrict = this.form.subdistrict;
}
} else if(this.dept.ancestors.split(',').length == 3){ } else if(this.dept.ancestors.split(',').length == 3){
if(Array.isArray(this.form.subdistrict)) {
this.subdistrict = this.form.subdistrict.slice(1, 11); this.subdistrict = this.form.subdistrict.slice(1, 11);
} else {
this.subdistrict = this.form.subdistrict;
}
} }
this.getTable({...pages,...this.form,subdistrict:this.subdistrict}); this.getTable({...pages,...this.form,subdistrict:this.subdistrict});
}, },
@ -767,36 +783,46 @@ export default {
return ""; return "";
}, },
commentData(item,dept) { commentData(item,dept) {
// item.map((item)=>{
// if(item.children instanceof Array && item.children.length == 0){
// item.county = item.subdistrict
// delete item.children;
// } else {
// // this.props.value = 'subdistrict'
// this.commentData(item.children,dept)
// }
// })
item.map((item)=>{ item.map((item)=>{
if(item.children instanceof Array && item.children.length == 0){ item.children.map((itemTwo)=>{
item.county = item.subdistrict itemTwo.county = itemTwo.subdistrict
delete item.children;
} else {
// this.props.value = 'subdistrict'
this.commentData(item.children,dept)
}
}) })
this.myDistrict = item; })
// this.myDistrict = item;
this.listOne = item this.listOne = item
if(dept.ancestors.split(',').length == 2) { if(dept.ancestors.split(',').length == 2) {
this.listOne = this.listOne.filter((item)=>{ this.listOne = this.listOne.filter((item)=>{
return item.institutionName == dept.deptName return item.institutionName == dept.deptName
}) })
// this.listOne.map((item)=>{ this.listOne.map((item)=>{
// if(item.institutionName == dept.deptName) { if(item.institutionName == dept.deptName) {
// this.form.subdistrict = item.county console.log(item.county)
// this.workingArea = item.county this.form.subdistrict = item.county
this.workingArea = item.county
this.county = true;
// delete item.children // delete item.children
// } }
// }) })
// this.disabled = true; // this.disabled = true;
} else if(dept.ancestors.split(',').length == 3) { } else if(dept.ancestors.split(',').length == 3) {
this.listOne.map((item)=>{ this.listOne.map((item)=>{
if(item.institutionName == dept.deptName) { item.children.map((itemTwo)=>{
this.form.subdistrict = item.subdistrict if(itemTwo.institutionName == dept.deptName) {
this.workingArea = item.county this.form.subdistrict = itemTwo.subdistrict
this.workingArea = itemTwo.county
this.county = false;
} }
}) })
})
this.disabled = true; this.disabled = true;
} }
}, },

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-09-04 10:20:06 * @Date: 2023-09-04 10:20:06
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-09-28 13:44:14 * @LastEditTime: 2023-09-29 15:40:31
--> -->
<template> <template>
<div class="plan-management"> <div class="plan-management">
@ -246,6 +246,7 @@
isExpandAll: true, isExpandAll: true,
// //
refreshTable: true, refreshTable: true,
county:false
} }
}, },
computed: { computed: {
@ -275,11 +276,12 @@
// //
} else { } else {
// //
if(this.mydistrict){ if(this.county){
let district = this.form.district.slice(1, 11); let district = this.form.district.slice(1, 8);
obj = { ...this.pages, ...this.form,district }; obj = { ...this.pages, ...this.form,district };
} else { } else {
obj = this.pages let district = this.form.district.slice(1, 11);
obj = { ...this.pages, ...this.form,district };
} }
} }
} else { } else {
@ -288,11 +290,12 @@
// this.subdistrict = this.form.subdistrict.slice(1, 8); // this.subdistrict = this.form.subdistrict.slice(1, 8);
// obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict }; // obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
// } else if(this.dept.ancestors.split(',').length == 3){ // } else if(this.dept.ancestors.split(',').length == 3){
let district = this.form.district.slice(1, 11); // let district = this.form.district.slice(1, 11);
let district = this.form.district;
obj = { ...this.pages, ...this.form,district }; obj = { ...this.pages, ...this.form,district };
// } // }
} }
// console.log(obj,'obj') console.log(obj,'obj')
this.getList(obj) this.getList(obj)
}, },
deep:true, deep:true,
@ -301,9 +304,11 @@
methods:{ methods:{
// //
componendDistrict(district){ componendDistrict(district){
// console.log(district)
// console.log(this.myDistrict)
let name let name
this.myDistrict.map((item)=>{ this.myDistrict.map((item)=>{
if(item.subdistrict == district) { if(item.county == district) {
name = item.institutionName name = item.institutionName
} else { } else {
item.children.map((itemTwo)=>{ item.children.map((itemTwo)=>{
@ -334,10 +339,21 @@
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
let district
if(Array.isArray(this.form.district)){
if(this.form.district.length == 1){
district = this.form.district[0];
} else if(this.form.district.length == 2){
district = this.form.district[1];
}
} else {
district = this.form.district;
}
this.download( this.download(
"/pharmaceuticals/bPlanManage/export", "/pharmaceuticals/bPlanEnterprise/exportplan",
{ {
...this.form, ...this.form,
district
}, },
`计划管理.xlsx` `计划管理.xlsx`
); );
@ -375,6 +391,7 @@
this.pages.pageSize = 10; this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages(); this.$refs.mypagination.defaultPages();
let obj = {...this.pages,district} let obj = {...this.pages,district}
console.log('123')
this.getList(obj); this.getList(obj);
}, },
// //
@ -449,15 +466,19 @@
this.total = res.data.total this.total = res.data.total
}, },
commentData(item,dept){ commentData(item,dept){
// if(dept.ancestors.split(',').length == 3) {
item.map((item)=>{ item.map((item)=>{
if(item.children instanceof Array && item.children.length == 0){ // if(item.children instanceof Array && item.children.length == 0){
item.county = item.subdistrict // item.county = item.subdistrict
delete item.children; // delete item.children;
} else { // } else {
this.commentData(item.children,this.dept) // this.commentData(item.children,this.dept)
} // }
item.children.map((itemTwo)=>{
itemTwo.county = itemTwo.subdistrict
})
}) })
this.myDistrict = item; // }
this.options = item; this.options = item;
if(dept.ancestors.split(',').length == 2) { if(dept.ancestors.split(',').length == 2) {
this.options = this.options.filter((item)=>{ this.options = this.options.filter((item)=>{
@ -465,29 +486,38 @@
}) })
this.options.map((item)=>{ this.options.map((item)=>{
if(item.institutionName == dept.deptName) { if(item.institutionName == dept.deptName) {
console.log(item.county) // console.log(item.county)
this.form.district = item.county this.form.district = item.county;
this.mydistrict = item.county this.mydistrict = item.county;
this.county = true;
// delete item.children // delete item.children
} }
}) })
// this.disabled = true; // this.disabled = true;
} else if(dept.ancestors.split(',').length == 3) { } else if(dept.ancestors.split(',').length == 3) {
// console.log(this.options)
this.options.map((item)=>{ this.options.map((item)=>{
if(item.institutionName == dept.deptName) { // console.log(item.children,'item.children')
console.log(item.institutionName) item.children.map((itemTwo)=>{
this.form.district = item.subdistrict if(itemTwo.institutionName == dept.deptName) {
this.mydistrict = item.subdistrict this.form.district = itemTwo.subdistrict;
// this.form.district.push(item.county,itemTwo.subdistrict);
// console.log(this.form.district,'item.institutionName')
this.mydistrict = itemTwo.subdistrict;
this.county = false;
// delete itemTwo.children
} }
}) })
})
this.disabled = true; this.disabled = true;
} }
} }
}, },
async created() { async created() {
console.log(this.dept) console.log(this.dept)
// console.log(this.district) this.myDistrict = this.district;
this.checkListTwo = this.checkList; console.log(this.myDistrict)
// this.checkListTwo = this.checkList;
// this.$nextTick(()=>{ // this.$nextTick(()=>{
// let dom = document.getElementsByClassName('tables'); // let dom = document.getElementsByClassName('tables');
// let height = dom[0].getBoundingClientRect(); // let height = dom[0].getBoundingClientRect();

Loading…
Cancel
Save