From 05105fb0d65ba17bac596607ba156bb39d28cf87 Mon Sep 17 00:00:00 2001 From: laozt <2721205210@qq.com> Date: Wed, 25 Oct 2023 10:05:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=A2=9E=E6=9C=AA?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/yingji/planManage.vue | 67 ++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/src/views/yingji/planManage.vue b/src/views/yingji/planManage.vue index 01232d1..b4de16a 100644 --- a/src/views/yingji/planManage.vue +++ b/src/views/yingji/planManage.vue @@ -188,7 +188,7 @@ export default { this.pages.pageSize = 10; this.$refs.mypagination.defaultPages(); let obj; - console.log(newForm, "newForm"); + // console.log(newForm, "newForm"); // 如果是苏州市或者是某个区 if (!this.disabled) { if (Array.isArray(newForm.district)) { @@ -335,29 +335,60 @@ export default { // console.log('obj',obj) this.getList(obj); }, + // 发布成功后关闭dialog事件触发 padlockOne() { this.pages.pageNum = 1; this.pages.pageSize = 10; this.$refs.mypagination.defaultPages(); - if (this.dept.ancestors.split(",").length == 1) { - if (this.form.district.length == 0 || this.form.plannedYear == "") { - this.getList(this.pages); + let obj; + if (!this.disabled) { + if (Array.isArray(this.form.district)) { + if (this.form.district.length == 2) { + let district = this.form.district[1].slice(0, 10); + obj = { ...this.pages, ...this.form, district }; + } else if (this.form.district.length == 1) { + let district = this.form.district[0].slice(0, 7); + obj = { ...this.pages, ...this.form, district }; + } else { + obj = { ...this.pages, ...this.form }; + } + // 不是数组 } else { - this.form.district = []; - this.form.plannedYear = ""; + // 判断是区县 + if (this.county) { + let district = this.form.district.slice(0, 7); + obj = { ...this.pages, ...this.form, district }; + } else { + let district = this.form.district.slice(0, 10); + obj = { ...this.pages, ...this.form, district }; + } } } else { - if ( - this.form.district == this.mydistrict || - this.form.plannedYear == "" - ) { - this.getList(this.pages); - } else { - this.form.district = this.mydistrict; - this.form.plannedYear = ""; - } + // 不是苏州市是乡镇 + let district = this.form.district; + obj = { ...this.pages, ...this.form, district }; } - // this.getList(this.pages); + // console.log('obj',obj) + this.getList(obj); + + // if (this.dept.ancestors.split(",").length == 1) { + // if (this.form.district.length == 0 || this.form.plannedYear == "") { + // this.getList(this.pages); + // } else { + // this.form.district = []; + // this.form.plannedYear = ""; + // } + // } else { + // if ( + // this.form.district == this.mydistrict || + // this.form.plannedYear == "" + // ) { + // this.getList(this.pages); + // } else { + // this.form.district = this.mydistrict; + // this.form.plannedYear = ""; + // } + // } }, // 区划级联选择器选择触发 handleChange(value) {}, @@ -477,8 +508,8 @@ export default { async created() { // let data = await this.$api.yingji.tree(); // this.myDistrict = data.data; - let treeData = JSON.parse(localStorage.getItem("TREE_DATA")) - this.myDistrict = treeData + let treeData = JSON.parse(localStorage.getItem("TREE_DATA")); + this.myDistrict = treeData; this.commentData(treeData, this.dept); if (this.dept.ancestors.split(",").length == 1) {