@@ -246,6 +246,7 @@
isExpandAll: true,
// 重新渲染表格状态
refreshTable: true,
+ county:false
}
},
computed: {
@@ -269,17 +270,18 @@
let district = this.form.district[1].slice(1, 11);
obj = { ...this.pages, ...this.form,district };
} else if(newForm.district.length == 1) {
- let district = this.form.district.slice[0](1, 8);
+ let district = this.form.district[0].slice(1, 8);
obj = { ...this.pages, ...this.form,district };
}
// 不是数组
} else {
// 判断是区县
- if(this.mydistrict){
- let district = this.form.district.slice(1, 11);
+ if(this.county){
+ let district = this.form.district.slice(1, 8);
obj = { ...this.pages, ...this.form,district };
} else {
- obj = this.pages
+ let district = this.form.district.slice(1, 11);
+ obj = { ...this.pages, ...this.form,district };
}
}
} else {
@@ -288,11 +290,12 @@
// this.subdistrict = this.form.subdistrict.slice(1, 8);
// obj = { ...this.pages, ...this.form,subdistrict:this.subdistrict };
// } 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 };
// }
}
- // console.log(obj,'obj')
+ console.log(obj,'obj')
this.getList(obj)
},
deep:true,
@@ -301,9 +304,11 @@
methods:{
// 匹配行政区划
componendDistrict(district){
+ // console.log(district)
+ // console.log(this.myDistrict)
let name
this.myDistrict.map((item)=>{
- if(item.subdistrict == district) {
+ if(item.county == district) {
name = item.institutionName
} else {
item.children.map((itemTwo)=>{
@@ -334,10 +339,21 @@
type: "warning",
})
.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(
- "/pharmaceuticals/bPlanManage/export",
+ "/pharmaceuticals/bPlanEnterprise/exportplan",
{
...this.form,
+ district
},
`计划管理.xlsx`
);
@@ -375,6 +391,7 @@
this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages();
let obj = {...this.pages,district}
+ console.log('123')
this.getList(obj);
},
// 区划级联选择器选择触发
@@ -444,20 +461,24 @@
let res = await this.$api.yingji.planmx(pages);
if(res.code == 200) {
this.loading = false;
+ this.tableData = res.data.list;
+ this.total = res.data.total
}
- this.tableData = res.data.list;
- this.total = res.data.total
},
commentData(item,dept){
- item.map((item)=>{
- if(item.children instanceof Array && item.children.length == 0){
- item.county = item.subdistrict
- delete item.children;
- } else {
- this.commentData(item.children,this.dept)
- }
- })
- this.myDistrict = item;
+ // if(dept.ancestors.split(',').length == 3) {
+ item.map((item)=>{
+ // if(item.children instanceof Array && item.children.length == 0){
+ // item.county = item.subdistrict
+ // delete item.children;
+ // } else {
+ // this.commentData(item.children,this.dept)
+ // }
+ item.children.map((itemTwo)=>{
+ itemTwo.county = itemTwo.subdistrict
+ })
+ })
+ // }
this.options = item;
if(dept.ancestors.split(',').length == 2) {
this.options = this.options.filter((item)=>{
@@ -465,20 +486,28 @@
})
this.options.map((item)=>{
if(item.institutionName == dept.deptName) {
- console.log(item.county)
- this.form.district = item.county
- this.mydistrict = item.county
+ // console.log(item.county)
+ this.form.district = item.county;
+ this.mydistrict = item.county;
+ this.county = true;
// delete item.children
}
})
// this.disabled = true;
} else if(dept.ancestors.split(',').length == 3) {
+ // console.log(this.options)
this.options.map((item)=>{
- if(item.institutionName == dept.deptName) {
- console.log(item.institutionName)
- this.form.district = item.subdistrict
- this.mydistrict = item.subdistrict
- }
+ // console.log(item.children,'item.children')
+ item.children.map((itemTwo)=>{
+ if(itemTwo.institutionName == dept.deptName) {
+ 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;
}
@@ -486,8 +515,9 @@
},
async created() {
console.log(this.dept)
- // console.log(this.district)
- this.checkListTwo = this.checkList;
+ this.myDistrict = this.district;
+ console.log(this.myDistrict)
+ // this.checkListTwo = this.checkList;
// this.$nextTick(()=>{
// let dom = document.getElementsByClassName('tables');
// let height = dom[0].getBoundingClientRect();